mirror of
https://github.com/italicsjenga/muda.git
synced 2024-12-23 20:11:29 +11:00
fix(linux): menu must be the container's first child (#89)
* fix(linux): menu must be the container's first child * check if gtk box instead * Revert "check if gtk box instead" * update change file
This commit is contained in:
parent
bb92b5667e
commit
7ca4b11564
5
.changes/gtk-add-menu-position.md
Normal file
5
.changes/gtk-add-menu-position.md
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
---
|
||||||
|
"muda": minor
|
||||||
|
---
|
||||||
|
|
||||||
|
**Breaking Change:** On Linux, `Menu::inti_for_gtk_window` has been changed to require the second paramter to extend `gtk::Box`. This ensures that the menu bar is added at the beginning of the box instead of at the bottom.
|
|
@ -147,6 +147,7 @@ impl Menu {
|
||||||
W: gtk::prelude::IsA<gtk::Window>,
|
W: gtk::prelude::IsA<gtk::Window>,
|
||||||
W: gtk::prelude::IsA<gtk::Container>,
|
W: gtk::prelude::IsA<gtk::Container>,
|
||||||
C: gtk::prelude::IsA<gtk::Container>,
|
C: gtk::prelude::IsA<gtk::Container>,
|
||||||
|
C: gtk::prelude::IsA<gtk::Box>,
|
||||||
{
|
{
|
||||||
self.0.borrow_mut().init_for_gtk_window(window, container)
|
self.0.borrow_mut().init_for_gtk_window(window, container)
|
||||||
}
|
}
|
||||||
|
|
|
@ -217,6 +217,7 @@ impl Menu {
|
||||||
W: IsA<gtk::Window>,
|
W: IsA<gtk::Window>,
|
||||||
W: IsA<gtk::Container>,
|
W: IsA<gtk::Container>,
|
||||||
C: IsA<gtk::Container>,
|
C: IsA<gtk::Container>,
|
||||||
|
C: IsA<gtk::Box>,
|
||||||
{
|
{
|
||||||
let id = window.as_ptr() as u32;
|
let id = window.as_ptr() as u32;
|
||||||
|
|
||||||
|
@ -245,6 +246,7 @@ impl Menu {
|
||||||
// add the menubar to the specified widget, otherwise to the window
|
// add the menubar to the specified widget, otherwise to the window
|
||||||
if let Some(container) = container {
|
if let Some(container) = container {
|
||||||
container.add(menu_bar);
|
container.add(menu_bar);
|
||||||
|
container.reorder_child(menu_bar, 0);
|
||||||
} else {
|
} else {
|
||||||
window.add(menu_bar);
|
window.add(menu_bar);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue