diff --git a/.changes/gtk-add-menu-position.md b/.changes/gtk-add-menu-position.md new file mode 100644 index 0000000..3201749 --- /dev/null +++ b/.changes/gtk-add-menu-position.md @@ -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. diff --git a/src/menu.rs b/src/menu.rs index 8279be0..65d99c6 100644 --- a/src/menu.rs +++ b/src/menu.rs @@ -147,6 +147,7 @@ impl Menu { W: gtk::prelude::IsA, W: gtk::prelude::IsA, C: gtk::prelude::IsA, + C: gtk::prelude::IsA, { self.0.borrow_mut().init_for_gtk_window(window, container) } diff --git a/src/platform_impl/gtk/mod.rs b/src/platform_impl/gtk/mod.rs index 5fa92a3..00b0ce6 100644 --- a/src/platform_impl/gtk/mod.rs +++ b/src/platform_impl/gtk/mod.rs @@ -217,6 +217,7 @@ impl Menu { W: IsA, W: IsA, C: IsA, + C: IsA, { let id = window.as_ptr() as u32; @@ -245,6 +246,7 @@ impl Menu { // add the menubar to the specified widget, otherwise to the window if let Some(container) = container { container.add(menu_bar); + container.reorder_child(menu_bar, 0); } else { window.add(menu_bar); }