[gtk+/gtk-style-context] Make expanders prelight



commit 82eea99e04862f4bee346c407d7a089541dfb57f
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Nov 22 18:56:10 2010 -0500

    Make expanders prelight

 gtk/gtkcssprovider.c   |    4 ++++
 gtk/gtkstyle.c         |    2 ++
 gtk/gtkthemingengine.c |   10 ++++++----
 3 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index f74d041..5b15901 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -3436,6 +3436,10 @@ gtk_css_provider_get_default (void)
         "  color: @selected_fg_color;\n"
         "}\n"
         "\n"
+        ".expander:prelight {\n"
+        "  color: @selected_fg_color\n"
+        "}\n"
+        "\n"
         "*:insensitive {\n"
         "  background-color: shade (@bg_color, 0.9);\n"
         "  color: shade (@bg_color, 0.7);\n"
diff --git a/gtk/gtkstyle.c b/gtk/gtkstyle.c
index 1da8821..6fddf0c 100644
--- a/gtk/gtkstyle.c
+++ b/gtk/gtkstyle.c
@@ -3215,6 +3215,8 @@ gtk_default_draw_expander (GtkStyle        *style,
   if (detail)
     transform_detail_string (detail, context);
 
+  gtk_style_context_add_class (context, "expander");
+
   switch (state_type)
     {
     case GTK_STATE_PRELIGHT:
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index da50cd5..f7961bc 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -1748,7 +1748,7 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
                                     gdouble           height)
 {
   GtkStateFlags flags;
-  GdkRGBA *bg_color, *fg_color;
+  GdkRGBA *outline_color, *fg_color;
   double vertical_overshoot;
   int diameter;
   double radius;
@@ -1764,7 +1764,9 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
 
   gtk_theming_engine_get (engine, flags,
                           "color", &fg_color,
-                          "background-color", &bg_color,
+                          NULL);
+  gtk_theming_engine_get (engine, 0,
+                          "color", &outline_color,
                           NULL);
 
   line_width = 1;
@@ -1834,13 +1836,13 @@ gtk_theming_engine_render_expander (GtkThemingEngine *engine,
 
   cairo_fill_preserve (cr);
 
-  gdk_cairo_set_source_rgba (cr, fg_color);
+  gdk_cairo_set_source_rgba (cr, outline_color);
   cairo_stroke (cr);
 
   cairo_restore (cr);
 
   gdk_rgba_free (fg_color);
-  gdk_rgba_free (bg_color);
+  gdk_rgba_free (outline_color);
 }
 
 static void



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