mirror of https://github.com/GNOME/gimp.git
app: add gimp_display_shell_set_action_sensitive()
This commit is contained in:
parent
762e324d9a
commit
a942b771fb
|
@ -34,6 +34,44 @@
|
||||||
#include "gimpimagewindow.h"
|
#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
|
void
|
||||||
gimp_display_shell_set_action_active (GimpDisplayShell *shell,
|
gimp_display_shell_set_action_active (GimpDisplayShell *shell,
|
||||||
const gchar *action,
|
const gchar *action,
|
||||||
|
|
|
@ -19,12 +19,15 @@
|
||||||
#define __GIMP_DISPLAY_SHELL_ACTIONS_H__
|
#define __GIMP_DISPLAY_SHELL_ACTIONS_H__
|
||||||
|
|
||||||
|
|
||||||
void gimp_display_shell_set_action_active (GimpDisplayShell *shell,
|
void gimp_display_shell_set_action_sensitive (GimpDisplayShell *shell,
|
||||||
const gchar *action,
|
const gchar *action,
|
||||||
gboolean active);
|
gboolean sensitive);
|
||||||
void gimp_display_shell_set_action_color (GimpDisplayShell *shell,
|
void gimp_display_shell_set_action_active (GimpDisplayShell *shell,
|
||||||
const gchar *action,
|
const gchar *action,
|
||||||
const GimpRGB *color);
|
gboolean active);
|
||||||
|
void gimp_display_shell_set_action_color (GimpDisplayShell *shell,
|
||||||
|
const gchar *action,
|
||||||
|
const GimpRGB *color);
|
||||||
|
|
||||||
|
|
||||||
#endif /* __GIMP_DISPLAY_SHELL_ACTIONS_H__ */
|
#endif /* __GIMP_DISPLAY_SHELL_ACTIONS_H__ */
|
||||||
|
|
Loading…
Reference in New Issue