murrine r115 - in trunk: . src
- From: acimitan svn gnome org
- To: svn-commits-list gnome org
- Subject: murrine r115 - in trunk: . src
- Date: Fri, 2 Jan 2009 21:12:46 +0000 (UTC)
Author: acimitan
Date: Fri Jan 2 21:12:46 2009
New Revision: 115
URL: http://svn.gnome.org/viewvc/murrine?rev=115&view=rev
Log:
2009-01-02 Andrea Cimitan <andrea cimitan gmail com>
* src/murrine_draw.c (murrine_scale_draw_gradient),
(murrine_draw_scale_trough):
* src/murrine_draw_rgba.c (murrine_scale_draw_gradient),
(murrine_rgba_draw_scale_trough):
Added a small lightborder inside the scale gradient.
Modified:
trunk/ChangeLog
trunk/src/murrine_draw.c
trunk/src/murrine_draw_rgba.c
Modified: trunk/src/murrine_draw.c
==============================================================================
--- trunk/src/murrine_draw.c (original)
+++ trunk/src/murrine_draw.c Fri Jan 2 21:12:46 2009
@@ -312,16 +312,40 @@
murrine_scale_draw_gradient (cairo_t *cr,
const MurrineRGB *c1,
const MurrineRGB *c2,
+ double lightborder_shade,
int x, int y, int width, int height,
- boolean alpha)
+ boolean alpha, boolean horizontal)
{
- murrine_set_color_rgba (cr, c1, alpha ? 0.44 : 1);
+ murrine_set_color_rgba (cr, c1, alpha ? 0.44 : 1.0);
cairo_rectangle (cr, x, y, width, height);
cairo_fill (cr);
murrine_set_color_rgba (cr, c2, 0.8);
cairo_rectangle (cr, x, y, width, height);
cairo_stroke (cr);
+
+ if (lightborder_shade != 1.0)
+ {
+ MurrineRGB lightborder;
+ murrine_shade (c1, lightborder_shade, &lightborder);
+
+ if (horizontal)
+ {
+ cairo_move_to (cr, x+1, height-1);
+ cairo_rel_line_to (cr, 0, -height+2);
+ cairo_rel_line_to (cr, width-2, 0);
+ cairo_rel_line_to (cr, 0, height-2);
+ }
+ else
+ {
+ cairo_move_to (cr, width-1, y+1);
+ cairo_rel_line_to (cr, -width+2, 0);
+ cairo_rel_line_to (cr, 0, height-2);
+ cairo_rel_line_to (cr, width-2, 0);
+ }
+ murrine_set_color_rgba (cr, &lightborder, 0.5);
+ cairo_stroke (cr);
+ }
}
static void
@@ -382,13 +406,15 @@
murrine_scale_draw_gradient (cr, &fill, /* fill */
&colors->shade[4], /* border */
+ 1.0,
0, 0, trough_width, trough_height,
- TRUE);
+ TRUE, slider->horizontal);
murrine_scale_draw_gradient (cr, &colors->spot[1], /* fill */
&colors->spot[2], /* border */
+ widget->lightborder_shade,
fill_x, fill_y, fill_width, fill_height,
- FALSE);
+ FALSE, slider->horizontal);
}
static void
@@ -1200,7 +1226,7 @@
pat = cairo_pattern_create_linear (0.0, height-4.0, 0.0, height-1.0);
murrine_pattern_add_color_stop_rgba (pat, 0.0, &shadow_header, 0.0);
murrine_pattern_add_color_stop_rgb (pat, 1.0, &shadow_header);
- cairo_set_source (cr, pat);
+ cairo_set_source (cr, pat);
cairo_pattern_destroy (pat);
cairo_rectangle (cr, 0.0, height-4.0, width, 3.0);
}
Modified: trunk/src/murrine_draw_rgba.c
==============================================================================
--- trunk/src/murrine_draw_rgba.c (original)
+++ trunk/src/murrine_draw_rgba.c Fri Jan 2 21:12:46 2009
@@ -300,8 +300,9 @@
murrine_scale_draw_gradient (cairo_t *cr,
const MurrineRGB *c1,
const MurrineRGB *c2,
+ double lightborder_shade,
int x, int y, int width, int height,
- boolean alpha)
+ boolean alpha, boolean horizontal)
{
murrine_set_color_rgba (cr, c1, alpha ? 0.46 : 1.0);
cairo_rectangle (cr, x, y, width, height);
@@ -310,6 +311,29 @@
murrine_set_color_rgba (cr, c2, 0.82);
cairo_rectangle (cr, x, y, width, height);
cairo_stroke (cr);
+
+ if (lightborder_shade != 1.0)
+ {
+ MurrineRGB lightborder;
+ murrine_shade (c1, lightborder_shade, &lightborder);
+
+ if (horizontal)
+ {
+ cairo_move_to (cr, x+1, height-1);
+ cairo_rel_line_to (cr, 0, -height+2);
+ cairo_rel_line_to (cr, width-2, 0);
+ cairo_rel_line_to (cr, 0, height-2);
+ }
+ else
+ {
+ cairo_move_to (cr, width-1, y+1);
+ cairo_rel_line_to (cr, -width+2, 0);
+ cairo_rel_line_to (cr, 0, height-2);
+ cairo_rel_line_to (cr, width-2, 0);
+ }
+ murrine_set_color_rgba (cr, &lightborder, 0.5);
+ cairo_stroke (cr);
+ }
}
static void
@@ -370,13 +394,15 @@
murrine_scale_draw_gradient (cr, &fill, /* fill */
&colors->shade[5], /* border */
+ 1.0,
0, 0, trough_width, trough_height,
- TRUE);
+ TRUE, slider->horizontal);
murrine_scale_draw_gradient (cr, &colors->spot[1], /* fill */
&colors->spot[2], /* border */
+ widget->lightborder_shade,
fill_x, fill_y, fill_width, fill_height,
- FALSE);
+ FALSE, slider->horizontal);
}
static void
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]