[fractal/fractal-next] context-menu-bin: Explicitly notify when on context-menu change



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]