From a88a02bde7401c566ee79f95b5ea7e9011332ffd Mon Sep 17 00:00:00 2001 From: Javier Date: Sat, 21 Jun 2014 18:13:19 +0200 Subject: allow for updateAction to change between radio and check --- module/menuproxy.cc | 6 +++--- 1 file 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()); } -- cgit v1.2.3