[gtk+] gtk: no need to add GTK_STYLE_FLAG_FOCUSED to the widget's state flags



commit 5d3106275ac65713c49f708a06e0f33a004c3269
Author: Michael Natterer <mitch gimp org>
Date:   Fri Jan 21 15:38:52 2011 +0100

    gtk: no need to add GTK_STYLE_FLAG_FOCUSED to the widget's state flags
    
    because they correctly contain that flag now if the widget has focus.

 gtk/gtkentry.c       |    3 ---
 gtk/gtkspinbutton.c  |    3 ---
 gtk/gtktextdisplay.c |    3 ---
 3 files changed, 0 insertions(+), 9 deletions(-)
---
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index f05cc2c..b21146c 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3500,9 +3500,6 @@ gtk_entry_draw (GtkWidget *widget,
   context = gtk_widget_get_style_context (widget);
   state = gtk_widget_get_state_flags (widget);
 
-  if (gtk_widget_has_focus (widget))
-    state |= GTK_STATE_FLAG_FOCUSED;
-
   gtk_style_context_save (context);
   gtk_style_context_set_state (context, state);
 
diff --git a/gtk/gtkspinbutton.c b/gtk/gtkspinbutton.c
index 1d357e3..729cc89 100644
--- a/gtk/gtkspinbutton.c
+++ b/gtk/gtkspinbutton.c
@@ -928,9 +928,6 @@ gtk_spin_button_draw (GtkWidget      *widget,
 
   state = gtk_widget_get_state_flags (widget);
 
-  if (gtk_widget_has_focus (widget))
-    state |= GTK_STATE_FLAG_FOCUSED;
-
   gtk_style_context_save (context);
   gtk_style_context_set_state (context, state);
   gtk_style_context_remove_class (context, GTK_STYLE_CLASS_ENTRY);
diff --git a/gtk/gtktextdisplay.c b/gtk/gtktextdisplay.c
index a145c03..7ea85f7 100644
--- a/gtk/gtktextdisplay.c
+++ b/gtk/gtktextdisplay.c
@@ -210,9 +210,6 @@ gtk_text_renderer_prepare_run (PangoRenderer  *renderer,
     {
       state |= GTK_STATE_FLAG_SELECTED;
 
-      if (gtk_widget_has_focus (text_renderer->widget))
-        state |= GTK_STATE_FLAG_FOCUSED;
-
       gtk_style_context_get (context, state,
                              "color", &fg_rgba,
                               NULL);



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