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

app: add gimp_display_shell_set_action_sensitive()

parent 762e324d
......@@ -34,6 +34,44 @@
#include "gimpimagewindow.h"
void
gimp_display_shell_set_action_sensitive (GimpDisplayShell *shell,
const gchar *action,
gboolean sensitive)
{
GimpImageWindow *window;
GimpContext *context;
g_return_if_fail (GIMP_IS_DISPLAY_SHELL (shell));
g_return_if_fail (action != NULL);
window = gimp_display_shell_get_window (shell);
if (window && gimp_image_window_get_active_shell (window) == shell)
{
GimpUIManager *manager = gimp_image_window_get_ui_manager (window);
GimpActionGroup *action_group;
action_group = gimp_ui_manager_get_action_group (manager, "view");
if (action_group)
gimp_action_group_set_action_sensitive (action_group, action, sensitive);
}
context = gimp_get_user_context (shell->display->gimp);
if (shell->display == gimp_context_get_display (context))
{
GimpActionGroup *action_group;
action_group = gimp_ui_manager_get_action_group (shell->popup_manager,
"view");
if (action_group)
gimp_action_group_set_action_sensitive (action_group, action, sensitive);
}
}
void
gimp_display_shell_set_action_active (GimpDisplayShell *shell,
const gchar *action,
......
......@@ -19,12 +19,15 @@
#define __GIMP_DISPLAY_SHELL_ACTIONS_H__
void gimp_display_shell_set_action_active (GimpDisplayShell *shell,
const gchar *action,
gboolean active);
void gimp_display_shell_set_action_color (GimpDisplayShell *shell,
const gchar *action,
const GimpRGB *color);
void gimp_display_shell_set_action_sensitive (GimpDisplayShell *shell,
const gchar *action,
gboolean sensitive);
void gimp_display_shell_set_action_active (GimpDisplayShell *shell,
const gchar *action,
gboolean active);
void gimp_display_shell_set_action_color (GimpDisplayShell *shell,
const gchar *action,
const GimpRGB *color);
#endif /* __GIMP_DISPLAY_SHELL_ACTIONS_H__ */
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