[gimp/gtk3-port: 196/226] app: port the text tool editor's preedit popup to GtkStyleContext



commit a32199cf152429ddb16d21dd357d9845bc88b2e6
Author: Michael Natterer <mitch gimp org>
Date:   Sun Feb 27 15:15:37 2011 +0100

    app: port the text tool editor's preedit popup to GtkStyleContext

 app/tools/gimptexttool-editor.c |    9 ++++-----
 1 files changed, 4 insertions(+), 5 deletions(-)
---
diff --git a/app/tools/gimptexttool-editor.c b/app/tools/gimptexttool-editor.c
index 90db8b7..746fb35 100644
--- a/app/tools/gimptexttool-editor.c
+++ b/app/tools/gimptexttool-editor.c
@@ -1346,7 +1346,6 @@ gimp_text_tool_im_preedit_start (GtkIMContext *context,
 {
   GimpTool         *tool  = GIMP_TOOL (text_tool);
   GimpDisplayShell *shell = gimp_display_get_shell (tool->display);
-  GtkStyle         *style = gtk_widget_get_style (shell->canvas);
   GtkWidget        *frame;
   GtkWidget        *ebox;
   PangoRectangle    cursor_rect = { 0, };
@@ -1377,14 +1376,14 @@ gimp_text_tool_im_preedit_start (GtkIMContext *context,
   gtk_widget_show (frame);
 
   ebox = gtk_event_box_new ();
-  gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL,
-                        &style->base[GTK_STATE_NORMAL]);
+  gtk_style_context_add_class (gtk_widget_get_style_context (ebox),
+                               GTK_STYLE_CLASS_ENTRY);
   gtk_container_add (GTK_CONTAINER (frame), ebox);
   gtk_widget_show (ebox);
 
   text_tool->preedit_label = gtk_label_new (NULL);
-  gtk_widget_modify_bg (text_tool->preedit_label, GTK_STATE_NORMAL,
-                        &style->text[GTK_STATE_NORMAL]);
+  gtk_style_context_add_class (gtk_widget_get_style_context (text_tool->preedit_label),
+                               GTK_STYLE_CLASS_ENTRY);
   gtk_misc_set_padding (GTK_MISC (text_tool->preedit_label), 2, 2);
   gtk_container_add (GTK_CONTAINER (ebox), text_tool->preedit_label);
   gtk_widget_show (text_tool->preedit_label);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]