aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <albert.astals@canonical.com>2017-03-16 16:55:36 +0000
committerBileto Bot <ci-train-bot@canonical.com>2017-03-16 16:55:36 +0000
commit1e6ebccf6bd893e56f89e23794cc8844eb8ae968 (patch)
treeee79af37c29c2d6954d751f487805bf224c5a8fb
parentf0aa8c3ebfa80e7a44afe630053fe818e240b9f1 (diff)
parentc4855ff11d211bfc3dfe1534712293569ee1cb56 (diff)
downloadqmenumodel-1e6ebccf6bd893e56f89e23794cc8844eb8ae968.tar.gz
qmenumodel-1e6ebccf6bd893e56f89e23794cc8844eb8ae968.tar.bz2
qmenumodel-1e6ebccf6bd893e56f89e23794cc8844eb8ae968.zip
Use submenu-enabled for those items that don't have an action (if it exists) (LP: #1670694)
Approved by: Lukáš Tinkl
-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;
}