diff options
author | Javier <dev.git@javispedro.com> | 2014-06-21 18:13:19 +0200 |
---|---|---|
committer | Javier <dev.git@javispedro.com> | 2014-06-21 18:13:19 +0200 |
commit | a88a02bde7401c566ee79f95b5ea7e9011332ffd (patch) | |
tree | 3a75f131b470a9d10924a943fd8d31d62d63bbc1 | |
parent | da2181ab0281f7c6a3f1d6a91b8e939c635e9bbf (diff) | |
download | topmenu-qt-a88a02bde7401c566ee79f95b5ea7e9011332ffd.tar.gz topmenu-qt-a88a02bde7401c566ee79f95b5ea7e9011332ffd.zip |
allow for updateAction to change between radio and check
-rw-r--r-- | module/menuproxy.cc | 6 |
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()); } |