[fractal/fractal-next] context-menu-bin: Explicitly notify when on context-menu change
- From: Julian Sparber <jsparber src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [fractal/fractal-next] context-menu-bin: Explicitly notify when on context-menu change
- Date: Tue, 30 Nov 2021 14:00:12 +0000 (UTC)
commit e2da07732807ccf7fcd7a8610ba2860821c87662
Author: Kévin Commaille <zecakeh tedomum fr>
Date: Tue Nov 30 14:23:03 2021 +0100
context-menu-bin: Explicitly notify when on context-menu change
Now, the notification is also sent when calling directly `set_context_menu`.
src/components/context_menu_bin.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
---
diff --git a/src/components/context_menu_bin.rs b/src/components/context_menu_bin.rs
index fa34bc5f..02a5f6fd 100644
--- a/src/components/context_menu_bin.rs
+++ b/src/components/context_menu_bin.rs
@@ -73,7 +73,7 @@ mod imp {
"Context Menu",
"The context menu",
gio::MenuModel::static_type(),
- glib::ParamFlags::READWRITE,
+ glib::ParamFlags::READWRITE | glib::ParamFlags::EXPLICIT_NOTIFY,
)]
});
@@ -180,6 +180,7 @@ impl<O: IsA<ContextMenuBin>> ContextMenuBinExt for O {
fn set_context_menu(&self, menu: Option<gio::MenuModel>) {
let priv_ = imp::ContextMenuBin::from_instance(self.upcast_ref());
priv_.popover.set_menu_model(menu.as_ref());
+ self.notify("context-menu");
}
fn context_menu(&self) -> Option<gio::MenuModel> {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]