[gimp] app: honor the "gtk-show-input-method-menu" setting
- From: Michael Natterer <mitch src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] app: honor the "gtk-show-input-method-menu" setting
- Date: Wed, 13 Oct 2010 22:17:46 +0000 (UTC)
commit 56c50741d3da6d9f95fe591a248871dd1318a075
Author: Michael Natterer <mitch gimp org>
Date: Thu Oct 14 00:13:35 2010 +0200
app: honor the "gtk-show-input-method-menu" setting
and hide the input method menu when it's FALSE.
app/actions/text-tool-actions.c | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/app/actions/text-tool-actions.c b/app/actions/text-tool-actions.c
index 5930852..5c480b3 100644
--- a/app/actions/text-tool-actions.c
+++ b/app/actions/text-tool-actions.c
@@ -33,6 +33,7 @@
#include "widgets/gimphelp-ids.h"
#include "display/gimpdisplay.h"
+#include "display/gimpdisplayshell.h"
#include "tools/gimptool.h"
#include "tools/gimptexttool.h"
@@ -153,6 +154,8 @@ text_tool_actions_update (GimpActionGroup *group,
gboolean text_layer = FALSE;
gboolean text_sel = FALSE; /* some text is selected */
gboolean clip = FALSE; /* clipboard has text available */
+ gboolean input_method_menu;
+ gboolean unicode_menu;
layer = gimp_image_get_active_layer (image);
@@ -163,14 +166,17 @@ text_tool_actions_update (GimpActionGroup *group,
text_sel = gimp_text_tool_get_has_text_selection (text_tool);
- /*
- * see whether there is text available for pasting
- */
+ /* see whether there is text available for pasting */
shell = gimp_display_get_shell (display);
- clipboard = gtk_widget_get_clipboard (GTK_WIDGET (shell),
+ clipboard = gtk_widget_get_clipboard (shell->canvas,
GDK_SELECTION_CLIPBOARD);
clip = gtk_clipboard_wait_is_text_available (clipboard);
+ g_object_get (gtk_widget_get_settings (shell->canvas),
+ "gtk-show-input-method-menu", &input_method_menu,
+ "gtk-show-unicode-menu", &unicode_menu,
+ NULL);
+
#define SET_VISIBLE(action,condition) \
gimp_action_group_set_action_visible (group, action, (condition) != 0)
#define SET_SENSITIVE(action,condition) \
@@ -186,4 +192,6 @@ text_tool_actions_update (GimpActionGroup *group,
SET_SENSITIVE ("text-tool-load", image);
SET_SENSITIVE ("text-tool-text-to-path", text_layer);
SET_SENSITIVE ("text-tool-text-along-path", text_layer && vectors);
+
+ SET_VISIBLE ("text-tool-input-methods-menu", input_method_menu);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]