Commit aa0afe0d authored by Michael Natterer's avatar Michael Natterer 😴

app: invoke the right action when the quick mask button is clicked

instead of implementing the toggling in display/. One more bit
moved to actiona/.
parent 41754669
......@@ -306,9 +306,16 @@ gimp_display_shell_quick_mask_toggled (GtkWidget *widget,
if (active != gimp_image_get_quick_mask_state (image))
gimp_image_set_quick_mask_state (image, active);
GimpImageWindow *window = gimp_display_shell_get_window (shell);
if (window)
GimpUIManager *manager = gimp_image_window_get_ui_manager (window);
gimp_image_flush (image);
gimp_ui_manager_toggle_action (manager,
"quick-mask", "quick-mask-toggle",
......@@ -522,6 +522,25 @@ gimp_ui_manager_activate_action (GimpUIManager *manager,
return (action != NULL);
gimp_ui_manager_toggle_action (GimpUIManager *manager,
const gchar *group_name,
const gchar *action_name,
gboolean active)
GtkAction *action;
g_return_val_if_fail (GIMP_IS_UI_MANAGER (manager), FALSE);
g_return_val_if_fail (action_name != NULL, FALSE);
action = gimp_ui_manager_find_action (manager, group_name, action_name);
if (GTK_IS_TOGGLE_ACTION (action))
gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (action),
active ? TRUE : FALSE);
return GTK_IS_TOGGLE_ACTION (action);
gimp_ui_manager_ui_register (GimpUIManager *manager,
......@@ -89,6 +89,10 @@ GtkAction * gimp_ui_manager_find_action (GimpUIManager *manager,
gboolean gimp_ui_manager_activate_action (GimpUIManager *manager,
const gchar *group_name,
const gchar *action_name);
gboolean gimp_ui_manager_toggle_action (GimpUIManager *manager,
const gchar *group_name,
const gchar *action_name,
gboolean active);
void gimp_ui_manager_ui_register (GimpUIManager *manager,
const gchar *ui_path,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment