[gtk-engines/gnome3] Toolbar gradient.



commit 73dc63da916fe7e11a5ab66806b934486558b00c
Author: Benjamin Berg <benjamin sipsolutions net>
Date:   Sat Apr 3 18:38:56 2010 +0200

    Toolbar gradient.

 engines/clearlooks/src/clearlooks_draw_gnome3.c |   28 ++++++++++++++++++++++-
 themes/GNOME3/gtk-2.0/gtkrc                     |    3 +-
 2 files changed, 28 insertions(+), 3 deletions(-)
---
diff --git a/engines/clearlooks/src/clearlooks_draw_gnome3.c b/engines/clearlooks/src/clearlooks_draw_gnome3.c
index cb46ea4..9cae5e8 100644
--- a/engines/clearlooks/src/clearlooks_draw_gnome3.c
+++ b/engines/clearlooks/src/clearlooks_draw_gnome3.c
@@ -367,6 +367,32 @@ clearlooks_gnome3_draw_slider_button (cairo_t *cr,
 	cairo_restore (cr);
 }
 
+/* We can't draw transparent things here, since it will be called on the same
+ * surface multiple times, when placed on a handlebox_bin or dockitem_bin */
+static void
+clearlooks_gnome3_draw_toolbar (cairo_t *cr,
+                         const ClearlooksColors          *colors,
+                         const WidgetParameters          *widget,
+                         const ToolbarParameters         *toolbar,
+                         int x, int y, int width, int height)
+{
+	CairoColor top_bg = colors->bg[GTK_STATE_ACTIVE];
+	CairoColor bottom_bg = colors->bg[GTK_STATE_NORMAL];
+	cairo_pattern_t *pattern;
+
+	pattern = cairo_pattern_create_linear (x, y, x, y + height * 0.75);
+
+	ge_mix_color (&bottom_bg, &top_bg, 0.31, &bottom_bg);
+	ge_cairo_pattern_add_color_stop_color (pattern, 0.0, &top_bg);
+	ge_cairo_pattern_add_color_stop_color (pattern, 1.0, &bottom_bg);
+
+	cairo_set_source (cr, pattern);
+	cairo_rectangle (cr, x, y, width, height);
+	cairo_fill (cr);
+
+	cairo_pattern_destroy (pattern);
+}
+
 void
 clearlooks_register_style_gnome3 (ClearlooksStyleFunctions *functions, ClearlooksStyleConstants *constants)
 {
@@ -379,6 +405,7 @@ clearlooks_register_style_gnome3 (ClearlooksStyleFunctions *functions, Clearlook
 	functions->draw_scrollbar_slider    = clearlooks_gnome3_draw_scrollbar_slider;
 	functions->draw_scrollbar_trough    = clearlooks_gnome3_draw_scrollbar_trough;
 	functions->draw_slider_button       = clearlooks_gnome3_draw_slider_button;
+	functions->draw_toolbar             = clearlooks_gnome3_draw_toolbar;
 /*	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;
@@ -394,7 +421,6 @@ clearlooks_register_style_gnome3 (ClearlooksStyleFunctions *functions, Clearlook
 	functions->draw_separator           = clearlooks_draw_separator;
 	functions->draw_menu_item_separator = clearlooks_draw_menu_item_separator;
 	functions->draw_list_view_header    = clearlooks_draw_list_view_header;
-	functions->draw_toolbar             = clearlooks_draw_toolbar;
 	functions->draw_menuitem            = clearlooks_draw_menuitem;
 	functions->draw_menubaritem         = clearlooks_draw_menubaritem;
 	functions->draw_selected_cell       = clearlooks_draw_selected_cell;
diff --git a/themes/GNOME3/gtk-2.0/gtkrc b/themes/GNOME3/gtk-2.0/gtkrc
index b216597..a77f6e1 100644
--- a/themes/GNOME3/gtk-2.0/gtkrc
+++ b/themes/GNOME3/gtk-2.0/gtkrc
@@ -333,8 +333,7 @@ style "tooltips" {
 }
 
 style "toolbar" {
-	bg [NORMAL] = "#8a9580"
-	bg [ACTIVE] = "#c7ccc1" # second gradient color
+	bg [ACTIVE] = "#8a9580"
 }
 
 style "separator" = "wide" {



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