aboutsummaryrefslogtreecommitdiff
path: root/libqmenumodel/src
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2017-03-08 10:12:31 +0100
committerAlbert Astals Cid <albert.astals@canonical.com>2017-03-08 10:12:31 +0100
commitc4855ff11d211bfc3dfe1534712293569ee1cb56 (patch)
tree6c37cded236bd84792cfd696c189732c7421f4d7 /libqmenumodel/src
parent4e10e84a21f6d3f34898f7f8f4c922992e9c09ff (diff)
downloadqmenumodel-c4855ff11d211bfc3dfe1534712293569ee1cb56.tar.gz
qmenumodel-c4855ff11d211bfc3dfe1534712293569ee1cb56.tar.bz2
qmenumodel-c4855ff11d211bfc3dfe1534712293569ee1cb56.zip
Use submenu-enabled for those items that don't have an action (if it exists)
Diffstat (limited to 'libqmenumodel/src')
-rw-r--r--libqmenumodel/src/gtk/gtkmenutrackeritem.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/libqmenumodel/src/gtk/gtkmenutrackeritem.c b/libqmenumodel/src/gtk/gtkmenutrackeritem.c
index 0197701..650e719 100644
--- a/libqmenumodel/src/gtk/gtkmenutrackeritem.c
+++ b/libqmenumodel/src/gtk/gtkmenutrackeritem.c
@@ -469,7 +469,17 @@ _gtk_menu_tracker_item_new (GtkActionObservable *observable,
g_variant_unref (state);
}
else
- self->sensitive = TRUE;
+ {
+ gboolean submenu_enabled;
+ if (g_menu_item_get_attribute (self->item, "submenu-enabled", "b", &submenu_enabled))
+ {
+ self->sensitive = submenu_enabled;
+ }
+ else
+ {
+ self->sensitive = TRUE;
+ }
+ }
return self;
}