[gtk+/gtk-style-context: 141/490] GtkThemingEngine: Render frames and spinbutton boxes properly.



commit 15d02b2b1f5ea6809a34403680ec529b98a65f6f
Author: Carlos Garnacho <carlosg gnome org>
Date:   Mon Aug 2 15:48:31 2010 +0200

    GtkThemingEngine: Render frames and spinbutton boxes properly.

 gtk/gtkthemingengine.c |   44 +++++++++++++++++++++++++++++---------------
 1 files changed, 29 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkthemingengine.c b/gtk/gtkthemingengine.c
index 972722e..51d561d 100644
--- a/gtk/gtkthemingengine.c
+++ b/gtk/gtkthemingengine.c
@@ -940,7 +940,8 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
   color_shade (bg_color, 1.3, &lighter);
 
   if (gtk_theming_engine_has_class (engine, "entry") ||
-      gtk_theming_engine_has_class (engine, "scrolled-window"))
+      gtk_theming_engine_has_class (engine, "scrolled-window") ||
+      gtk_theming_engine_has_class (engine, "viewport"))
     {
       gdk_cairo_set_source_color (cr, bg_color);
       add_path_rectangle_sides (cr, x + 1, y + 1, width - 2, height - 2,
@@ -984,23 +985,36 @@ gtk_theming_engine_render_frame (GtkThemingEngine *engine,
     }
   else if (gtk_theming_engine_has_class (engine, "spinbutton"))
     {
-      gdk_cairo_set_source_color (cr, &lighter);
-      add_path_rectangle_sides (cr, x, y, width, height,
-                                SIDE_BOTTOM | SIDE_RIGHT);
-      cairo_stroke (cr);
+      if (gtk_theming_engine_has_class (engine, "button"))
+        {
+          gdk_cairo_set_source_color (cr, &lighter);
+          add_path_rectangle_sides (cr, x + 1, y + 2, width - 3, height - 2, SIDE_TOP);
+          cairo_stroke (cr);
 
-      gdk_cairo_set_source_color (cr, &darker);
-      add_path_rectangle_sides (cr, x, y, width, height, SIDE_TOP);
-      cairo_stroke (cr);
+          gdk_cairo_set_source_color (cr, &darker);
+          add_path_rectangle_sides (cr, x + 1, y + 2, width - 3, height - 2, SIDE_BOTTOM);
+          cairo_stroke (cr);
+        }
+      else
+        {
+          gdk_cairo_set_source_color (cr, &lighter);
+          add_path_rectangle_sides (cr, x, y, width, height,
+                                    SIDE_BOTTOM | SIDE_RIGHT);
+          cairo_stroke (cr);
 
-      gdk_cairo_set_source_color (cr, bg_color);
-      add_path_rectangle_sides (cr, x, y, width - 1, height - 1, SIDE_BOTTOM);
-      cairo_stroke (cr);
+          gdk_cairo_set_source_color (cr, &darker);
+          add_path_rectangle_sides (cr, x, y, width, height, SIDE_TOP);
+          cairo_stroke (cr);
 
-      cairo_set_source_rgb (cr, 0, 0, 0);
-      add_path_rectangle_sides (cr, x + 1, y + 1, width - 2, height - 2,
-                                SIDE_TOP | SIDE_LEFT | SIDE_RIGHT);
-      cairo_stroke (cr);
+          gdk_cairo_set_source_color (cr, bg_color);
+          add_path_rectangle_sides (cr, x, y, width - 1, height - 1, SIDE_BOTTOM);
+          cairo_stroke (cr);
+
+          cairo_set_source_rgb (cr, 0, 0, 0);
+          add_path_rectangle_sides (cr, x, y + 1, width - 1, height - 3,
+                                    SIDE_TOP | SIDE_LEFT | SIDE_RIGHT);
+          cairo_stroke (cr);
+        }
     }
   else
     {



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