aboutsummaryrefslogtreecommitdiff
path: root/module/menuproxy.cc
diff options
context:
space:
mode:
authorJavier <dev.git@javispedro.com>2014-06-21 18:13:19 +0200
committerJavier <dev.git@javispedro.com>2014-06-21 18:13:19 +0200
commita88a02bde7401c566ee79f95b5ea7e9011332ffd (patch)
tree3a75f131b470a9d10924a943fd8d31d62d63bbc1 /module/menuproxy.cc
parentda2181ab0281f7c6a3f1d6a91b8e939c635e9bbf (diff)
downloadtopmenu-qt-a88a02bde7401c566ee79f95b5ea7e9011332ffd.tar.gz
topmenu-qt-a88a02bde7401c566ee79f95b5ea7e9011332ffd.zip
allow for updateAction to change between radio and check
Diffstat (limited to 'module/menuproxy.cc')
-rw-r--r--module/menuproxy.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/module/menuproxy.cc b/module/menuproxy.cc
index d68a824..01a2b6f 100644
--- a/module/menuproxy.cc
+++ b/module/menuproxy.cc
@@ -112,9 +112,6 @@ GtkMenuItem * MenuProxy::addAction(QAction* action, QAction* before, QMenu* pare
} else if (action->isCheckable()) {
QString label = transformMnemonic(action->text());
item = GTK_MENU_ITEM(gtk_check_menu_item_new_with_mnemonic(label.toUtf8().constData()));
- if (action->actionGroup() && action->actionGroup()->isExclusive()) {
- gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item), TRUE);
- }
} else {
QString label = transformMnemonic(action->text());
QIcon icon = action->icon();
@@ -227,6 +224,9 @@ void MenuProxy::updateAction(QAction *action)
gtk_menu_item_set_label(item, label.toUtf8().constData());
if (GTK_IS_CHECK_MENU_ITEM(item)) {
+ gboolean is_radio = action->actionGroup() && action->actionGroup()->isExclusive();
+ gtk_check_menu_item_set_draw_as_radio(GTK_CHECK_MENU_ITEM(item),
+ is_radio);
gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(item),
action->isChecked());
}