[gtk+] Make unfocused selections visible in entries



commit fc10599ac8ae75d7f9027d069cf0de7345f4ebac
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 22 20:55:02 2010 -0500

    Make unfocused selections visible in entries

 gtk/gtkcssprovider.c |    4 ++++
 gtk/gtkentry.c       |    3 +--
 gtk/gtkstyle.c       |    3 +++
 3 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 02dffb0..7533db7 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -3498,6 +3498,10 @@ gtk_css_provider_get_default (void)
         "  background-color: shade (@base_color, 0.9);\n"
         "  color: shade (@base_color, 0.7);\n"
         "}\n"
+        ".entry:active {\n"
+        "  background-color: #c4c2bd;\n"
+        "  color: #000;\n"
+        "}\n"
         "\n"
         ".progressbar:prelight,\n"
         ".entry.progressbar {\n"
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index 7483a6c..2e58476 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -3419,8 +3419,7 @@ gtk_entry_draw_frame (GtkWidget      *widget,
     }
 
   style = gtk_widget_get_style (widget);
-  state = gtk_widget_has_focus (widget) ?
-    GTK_STATE_ACTIVE : gtk_widget_get_state (widget);
+  state = gtk_widget_get_state (widget);
 
   gtk_paint_flat_box (style, cr,
                       state, GTK_SHADOW_NONE,
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 6fddf0c..63769a5 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -2619,6 +2619,9 @@ gtk_default_draw_flat_box (GtkStyle      *style,
     case GTK_STATE_ACTIVE:
       flags |= GTK_STATE_FLAG_ACTIVE;
       break;
+    case GTK_STATE_FOCUSED:
+      flags |= GTK_STATE_FLAG_FOCUSED;
+      break;
     default:
       break;
     }



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