[gtk-engines/gnome3] Scrollbars, colors still quite broken though.



commit e71bc2c7dc9f2ad025d532949efb1ff27b82e439
Author: Benjamin Berg <benjamin sipsolutions net>
Date:   Sat Apr 3 11:52:44 2010 +0200

    Scrollbars, colors still quite broken though.

 engines/clearlooks/src/clearlooks_draw_gnome3.c |   68 ++++++++++++++++++++++-
 engines/clearlooks/src/clearlooks_style.c       |    2 +-
 themes/GNOME3/gtk-2.0/gtkrc                     |    5 +-
 3 files changed, 70 insertions(+), 5 deletions(-)
---
diff --git a/engines/clearlooks/src/clearlooks_draw_gnome3.c b/engines/clearlooks/src/clearlooks_draw_gnome3.c
index e78efc4..5f39947 100644
--- a/engines/clearlooks/src/clearlooks_draw_gnome3.c
+++ b/engines/clearlooks/src/clearlooks_draw_gnome3.c
@@ -200,6 +200,68 @@ clearlooks_gnome3_draw_arrow (cairo_t *cr,
 	cairo_restore (cr);
 }
 
+static void
+clearlooks_gnome3_draw_scrollbar_trough (cairo_t *cr,
+                                         const ClearlooksColors           *colors,
+                                         const WidgetParameters           *widget,
+                                         const ScrollBarParameters        *scrollbar,
+                                         int x, int y, int width, int height)
+{
+	const CairoColor *bg_color = &colors->bg[GTK_STATE_ACTIVE];
+	cairo_save (cr);
+
+	ge_cairo_set_color (cr, bg_color);
+	cairo_rectangle (cr, x, y, width, height);
+	cairo_fill (cr);
+
+	cairo_restore (cr);
+}
+
+static void
+clearlooks_gnome3_draw_scrollbar_button (cairo_t *cr,
+                                         const ClearlooksColors           *colors,
+                                         const WidgetParameters           *params,
+                                         const ScrollBarParameters        *scrollbar,
+                                         int x, int y,
+                                         int width, int height)
+{
+	const CairoColor *bg_color = &colors->bg[params->state_type];
+	const CairoColor *fg_color = &colors->fg[params->state_type];
+
+	cairo_save (cr);
+	ge_cairo_inner_rounded_rectangle (cr, x, y, width, height, params->radius, CR_CORNER_ALL);
+	ge_cairo_set_color (cr, bg_color);
+	cairo_fill_preserve (cr);
+	ge_cairo_set_color (cr, fg_color);
+	cairo_stroke (cr);
+	cairo_restore (cr);
+}
+
+static void
+clearlooks_gnome3_draw_scrollbar_stepper (cairo_t *cr,
+                                          const ClearlooksColors           *colors,
+                                          const WidgetParameters           *params,
+                                          const ScrollBarParameters        *scrollbar,
+                                          const ScrollBarStepperParameters *stepper,
+                                          int x, int y, int width, int height)
+{
+	clearlooks_gnome3_draw_scrollbar_button (cr, colors, params, scrollbar, x + 1, y + 1, width - 2, height - 2);
+}
+
+static void
+clearlooks_gnome3_draw_scrollbar_slider (cairo_t *cr,
+                                         const ClearlooksColors          *colors,
+                                         const WidgetParameters          *params,
+                                         const ScrollBarParameters       *scrollbar,
+                                         int x, int y, int width, int height)
+{
+	if (scrollbar->horizontal) {
+		clearlooks_gnome3_draw_scrollbar_button (cr, colors, params, scrollbar, x, y + 1, width, height - 2);
+	} else {
+		clearlooks_gnome3_draw_scrollbar_button (cr, colors, params, scrollbar, x + 1, y, width - 2, height);
+	}
+}
+
 void
 clearlooks_register_style_gnome3 (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants)
 {
@@ -207,6 +269,9 @@ clearlooks_register_style_gnome3 (ClearlooksStyleFunctions *functions, Clearlook
 
 	functions->draw_entry               = clearlooks_gnome3_draw_entry;
 	functions->draw_button              = clearlooks_gnome3_draw_button;
+	functions->draw_scrollbar_stepper   = clearlooks_gnome3_draw_scrollbar_stepper;
+	functions->draw_scrollbar_slider    = clearlooks_gnome3_draw_scrollbar_slider;
+	functions->draw_scrollbar_trough    = clearlooks_gnome3_draw_scrollbar_trough;
 /*	functions->draw_arrow               = clearlooks_gnome3_draw_arrow;
 	functions->draw_top_left_highlight  = clearlooks_draw_top_left_highlight;
 	functions->draw_scale_trough        = clearlooks_draw_scale_trough;
@@ -228,9 +293,6 @@ clearlooks_register_style_gnome3 (ClearlooksStyleFunctions *functions, Clearlook
 	functions->draw_menuitem            = clearlooks_draw_menuitem;
 	functions->draw_menubaritem         = clearlooks_draw_menubaritem;
 	functions->draw_selected_cell       = clearlooks_draw_selected_cell;
-	functions->draw_scrollbar_stepper   = clearlooks_draw_scrollbar_stepper;
-	functions->draw_scrollbar_slider    = clearlooks_draw_scrollbar_slider;
-	functions->draw_scrollbar_trough    = clearlooks_draw_scrollbar_trough;
 	functions->draw_statusbar           = clearlooks_draw_statusbar;
 	functions->draw_menu_frame          = clearlooks_draw_menu_frame;
 	functions->draw_tooltip             = clearlooks_draw_tooltip;
diff --git a/engines/clearlooks/src/clearlooks_style.c b/engines/clearlooks/src/clearlooks_style.c
index 49b3a49..296ece7 100644
--- a/engines/clearlooks/src/clearlooks_style.c
+++ b/engines/clearlooks/src/clearlooks_style.c
@@ -765,7 +765,7 @@ clearlooks_style_draw_box (DRAW_ARGS)
 			                      "trough-under-steppers", &trough_under_steppers,
 			                      NULL);
 
-		if (trough_under_steppers)
+		if (trough_under_steppers && clearlooks_style->style != CL_STYLE_GNOME3)
 		{
 			/* If trough under steppers is set, then we decrease the size
 			 * slightly. The size is decreased so that the trough is not
diff --git a/themes/GNOME3/gtk-2.0/gtkrc b/themes/GNOME3/gtk-2.0/gtkrc
index 332d415..3f9166e 100644
--- a/themes/GNOME3/gtk-2.0/gtkrc
+++ b/themes/GNOME3/gtk-2.0/gtkrc
@@ -49,6 +49,7 @@ style "default" {
 	GtkTreeView::expander-size = 14		# ???
 	GtkTreeView::vertical-separator = 0	# ???
 
+	GtkScrolledWindow::scrollbar-spacing = 0
 	GtkScrolledWindow::scrollbars-within-bevel = 1
 
 	GtkStatusBar::shadow-type = GTK_SHADOW_NONE
@@ -177,7 +178,9 @@ style "scrollbar" {
 	xthickness = 2
 	ythickness = 2
 
-	bg[NORMAL] = shade(0.91, @bg_color)
+	# Similar to buttons ...
+	bg[NORMAL] = shade(1.09, @bg_color)
+	fg[NORMAL] = mix (0.6, @bg_color, @fg_color)
 
 	engine "clearlooks" {
 		hint = "scrollbar"



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