[gnome-themes-standard] scale: use a margin to make the trough background/frame thinner



commit 26ec5df07abde52554dd2e01f930e45635789d42
Author: Cosimo Cecchi <cosimoc gnome org>
Date:   Wed May 16 00:17:09 2012 -0400

    scale: use a margin to make the trough background/frame thinner
    
    Now that GtkRange supports it.

 src/adwaita_engine.c                   |   61 --------------------------------
 src/adwaita_utils.c                    |   29 ---------------
 src/adwaita_utils.h                    |    7 ----
 themes/Adwaita/gtk-3.0/gtk-widgets.css |    8 ++++
 4 files changed, 8 insertions(+), 97 deletions(-)
---
diff --git a/src/adwaita_engine.c b/src/adwaita_engine.c
index 2b5dabe..34510d0 100644
--- a/src/adwaita_engine.c
+++ b/src/adwaita_engine.c
@@ -320,40 +320,6 @@ adwaita_engine_render_extension (GtkThemingEngine *engine,
 }
 
 static void
-adwaita_engine_render_frame (GtkThemingEngine *engine,
-                             cairo_t          *cr,
-                             gdouble           x,
-                             gdouble           y,
-                             gdouble           width,
-                             gdouble           height)
-{
-  adwaita_trim_allocation_for_scale (engine,
-                                     &x, &y,
-                                     &width, &height);
-
-  GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_frame
-    (engine, cr, x, y,
-     width, height);
-}
-
-static void
-adwaita_engine_render_background (GtkThemingEngine *engine,
-                                  cairo_t          *cr,
-                                  gdouble           x,
-                                  gdouble           y,
-                                  gdouble           width,
-                                  gdouble           height)
-{
-  adwaita_trim_allocation_for_scale (engine,
-                                     &x, &y,
-                                     &width, &height);
-
-  GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_background
-    (engine, cr, x, y,
-     width, height);
-}
-
-static void
 adwaita_engine_render_expander (GtkThemingEngine *engine,
                                 cairo_t          *cr,
                                 gdouble           x,
@@ -435,30 +401,6 @@ adwaita_engine_render_expander (GtkThemingEngine *engine,
 }
 
 static void
-adwaita_engine_render_activity (GtkThemingEngine *engine,
-                                cairo_t          *cr,
-                                gdouble           x,
-                                gdouble           y,
-                                gdouble           width,
-                                gdouble           height)
-{
-  GtkStateFlags state;
-
-  cairo_save (cr);
-  state = gtk_theming_engine_get_state (engine);
-
-  adwaita_trim_allocation_for_scale (engine,
-                                     &x, &y,
-                                     &width, &height);
-
-  GTK_THEMING_ENGINE_CLASS (adwaita_engine_parent_class)->render_activity
-    (engine, cr,
-     x, y, width, height);
-
-  cairo_restore (cr);
-}
-
-static void
 adwaita_engine_class_init (AdwaitaEngineClass *klass)
 {
   GtkThemingEngineClass *engine_class = GTK_THEMING_ENGINE_CLASS (klass);
@@ -466,10 +408,7 @@ adwaita_engine_class_init (AdwaitaEngineClass *klass)
   engine_class->render_arrow = adwaita_engine_render_arrow;
   engine_class->render_focus = adwaita_engine_render_focus;
   engine_class->render_extension = adwaita_engine_render_extension;
-  engine_class->render_frame = adwaita_engine_render_frame;
-  engine_class->render_background = adwaita_engine_render_background;
   engine_class->render_expander = adwaita_engine_render_expander;
-  engine_class->render_activity = adwaita_engine_render_activity;
 
   gtk_theming_engine_register_property (ADWAITA_NAMESPACE, NULL,
                                         g_param_spec_boxed ("focus-border-color",
diff --git a/src/adwaita_utils.c b/src/adwaita_utils.c
index 447f5b1..4928dab 100644
--- a/src/adwaita_utils.c
+++ b/src/adwaita_utils.c
@@ -26,35 +26,6 @@
 #include "adwaita_utils.h"
 
 void
-adwaita_trim_allocation_for_scale (GtkThemingEngine *engine,
-				   gdouble *x,
-				   gdouble *y,
-				   gdouble *width,
-				   gdouble *height)
-{
-  const GtkWidgetPath *path;
-
-  path = gtk_theming_engine_get_path (engine);
-
-  if (gtk_widget_path_is_type (path, GTK_TYPE_SCALE) &&
-      (gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_TROUGH) ||
-       gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_PROGRESSBAR)))
-    {
-      /* Render GtkScale trough thinner */
-      if (!gtk_theming_engine_has_class (engine, GTK_STYLE_CLASS_VERTICAL))
-        {
-          *y += *height / 2.0 - 2.0;
-          *height = 4;
-        }
-      else
-        {
-          *x += *width / 2.0 - 2.0;
-          *width = 4;
-        }
-    }
-}
-
-void
 _cairo_round_rectangle_sides (cairo_t          *cr,
                               gdouble           radius,
                               gdouble           x,
diff --git a/src/adwaita_utils.h b/src/adwaita_utils.h
index 7bf64a5..c14c861 100644
--- a/src/adwaita_utils.h
+++ b/src/adwaita_utils.h
@@ -37,13 +37,6 @@ enum {
 };
 
 void
-adwaita_trim_allocation_for_scale (GtkThemingEngine *engine,
-                                   gdouble *x,
-                                   gdouble *y,
-                                   gdouble *width,
-                                   gdouble *height);
-
-void
 _cairo_round_rectangle_sides (cairo_t          *cr,
                               gdouble           radius,
                               gdouble           x,
diff --git a/themes/Adwaita/gtk-3.0/gtk-widgets.css b/themes/Adwaita/gtk-3.0/gtk-widgets.css
index a9d8cbd..b6efd37 100644
--- a/themes/Adwaita/gtk-3.0/gtk-widgets.css
+++ b/themes/Adwaita/gtk-3.0/gtk-widgets.css
@@ -623,6 +623,14 @@ GtkScale.slider:insensitive:backdrop {
     /* background-image in -assets variant */
 }
 
+GtkScale.trough {
+    margin: 8px 0;
+}
+
+GtkScale.trough.vertical {
+    margin: 0 8px;
+}
+
 GtkScale.trough,
 GtkScale.trough.highlight,
 GtkScale.trough.vertical,



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