gtk-engines r1230 - in trunk: . engines/clearlooks/src
- From: davidz svn gnome org
- To: svn-commits-list gnome org
- Subject: gtk-engines r1230 - in trunk: . engines/clearlooks/src
- Date: Sun, 10 Aug 2008 20:18:04 +0000 (UTC)
Author: davidz
Date: Sun Aug 10 20:18:04 2008
New Revision: 1230
URL: http://svn.gnome.org/viewvc/gtk-engines?rev=1230&view=rev
Log:
2008-08-10 David Zeuthen <davidz redhat com>
* engines/clearlooks/src/clearlooks_draw.c:
(clearlooks_draw_radiobutton):
* engines/clearlooks/src/clearlooks_draw_glossy.c:
(clearlooks_glossy_draw_radiobutton):
* engines/clearlooks/src/clearlooks_draw_gummy.c:
(clearlooks_gummy_draw_radiobutton):
Avoid hardcoding the radio button size (#547024)
Modified:
trunk/ChangeLog
trunk/engines/clearlooks/src/clearlooks_draw.c
trunk/engines/clearlooks/src/clearlooks_draw_glossy.c
trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
Modified: trunk/engines/clearlooks/src/clearlooks_draw.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_draw.c Sun Aug 10 20:18:04 2008
@@ -2040,6 +2040,13 @@
cairo_pattern_t *pt;
gboolean inconsistent;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
+ gdouble w, h, cx, cy, radius;
+
+ w = (gdouble) width;
+ h = (gdouble) height;
+ cx = width / 2.0;
+ cy = height / 2.0;
+ radius = MIN (width, height) / 2.0;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -2058,7 +2065,7 @@
ge_shade_color (&widget->parentbg, 0.9, &shadow);
ge_shade_color (&widget->parentbg, 1.1, &highlight);
- pt = cairo_pattern_create_linear (0, 0, 13, 13);
+ pt = cairo_pattern_create_linear (0, 0, radius * 2.0, radius * 2.0);
cairo_pattern_add_color_stop_rgb (pt, 0.0, shadow.r, shadow.b, shadow.g);
cairo_pattern_add_color_stop_rgba (pt, 0.5, shadow.r, shadow.b, shadow.g, 0.5);
cairo_pattern_add_color_stop_rgba (pt, 0.5, highlight.r, highlight.g, highlight.b, 0.5);
@@ -2066,15 +2073,15 @@
cairo_translate (cr, x, y);
- cairo_set_line_width (cr, 2);
- cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
+ cairo_set_line_width (cr, MAX (1.0, floor (radius/3)));
+ cairo_arc (cr, ceil (cx), ceil (cy), floor (radius - 0.1), 0, G_PI*2);
cairo_set_source (cr, pt);
cairo_stroke (cr);
cairo_pattern_destroy (pt);
- cairo_set_line_width (cr, 1);
+ cairo_set_line_width (cr, MAX (1.0, floor (radius/6)));
- cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
+ cairo_arc (cr, ceil (cx), ceil (cy), MAX (1.0, ceil (radius) - 1.5), 0, G_PI*2);
if (!widget->disabled)
{
@@ -2090,21 +2097,21 @@
if (inconsistent)
{
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
- cairo_set_line_width (cr, 4);
+ cairo_set_line_width (cr, ceil (radius * 2 / 3));
- cairo_move_to(cr, 5, 7);
- cairo_line_to(cr, 9, 7);
+ cairo_move_to (cr, ceil (cx - radius/3.0), ceil (cy));
+ cairo_line_to (cr, ceil (cx + radius/3.0), ceil (cy));
ge_cairo_set_color (cr, dot);
cairo_stroke (cr);
}
else
{
- cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
+ cairo_arc (cr, ceil (cx), ceil (cy), floor (radius/2.0), 0, G_PI*2);
ge_cairo_set_color (cr, dot);
cairo_fill (cr);
- cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
+ cairo_arc (cr, floor (cx - radius/10.0), floor (cy - radius/10.0), floor (radius/6.0), 0, G_PI*2);
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
cairo_fill (cr);
}
Modified: trunk/engines/clearlooks/src/clearlooks_draw_glossy.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_glossy.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_glossy.c Sun Aug 10 20:18:04 2008
@@ -1280,6 +1280,13 @@
cairo_pattern_t *pt;
gboolean inconsistent;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
+ gdouble w, h, cx, cy, radius;
+
+ w = (gdouble) width;
+ h = (gdouble) height;
+ cx = width / 2.0;
+ cy = height / 2.0;
+ radius = MIN (width, height) / 2.0;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -1301,7 +1308,7 @@
ge_shade_color (&widget->parentbg, 0.9, &shadow);
ge_shade_color (&widget->parentbg, 1.1, &highlight);
- pt = cairo_pattern_create_linear (0, 0, 13, 13);
+ pt = cairo_pattern_create_linear (0, 0, radius * 2.0, radius * 2.0);
cairo_pattern_add_color_stop_rgb (pt, 0.0, shadow.r, shadow.b, shadow.g);
cairo_pattern_add_color_stop_rgba (pt, 0.5, shadow.r, shadow.b, shadow.g, 0.5);
cairo_pattern_add_color_stop_rgba (pt, 0.5, highlight.r, highlight.g, highlight.b, 0.5);
@@ -1309,15 +1316,15 @@
cairo_translate (cr, x, y);
- cairo_set_line_width (cr, 2);
- cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
+ cairo_set_line_width (cr, MAX (1.0, floor (radius/3)));
+ cairo_arc (cr, ceil (cx), ceil (cy), floor (radius - 0.1), 0, G_PI*2);
cairo_set_source (cr, pt);
cairo_stroke (cr);
cairo_pattern_destroy (pt);
- cairo_set_line_width (cr, 1);
+ cairo_set_line_width (cr, MAX (1.0, floor (radius/6)));
- cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
+ cairo_arc (cr, ceil (cx), ceil (cy), MAX (1.0, ceil (radius) - 1.5), 0, G_PI*2);
if (!widget->disabled)
{
@@ -1336,21 +1343,21 @@
if (inconsistent)
{
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
- cairo_set_line_width (cr, 4);
+ cairo_set_line_width (cr, ceil (radius * 2 / 3));
- cairo_move_to(cr, 5, 7);
- cairo_line_to(cr, 9, 7);
+ cairo_move_to (cr, ceil (cx - radius/3.0), ceil (cy));
+ cairo_line_to (cr, ceil (cx + radius/3.0), ceil (cy));
ge_cairo_set_color (cr, dot);
cairo_stroke (cr);
}
else
{
- cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
+ cairo_arc (cr, ceil (cx), ceil (cy), floor (radius/2.0), 0, G_PI*2);
ge_cairo_set_color (cr, dot);
cairo_fill (cr);
- cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
+ cairo_arc (cr, floor (cx - radius/10.0), floor (cy - radius/10.0), floor (radius/6.0), 0, G_PI*2);
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
cairo_fill (cr);
}
Modified: trunk/engines/clearlooks/src/clearlooks_draw_gummy.c
==============================================================================
--- trunk/engines/clearlooks/src/clearlooks_draw_gummy.c (original)
+++ trunk/engines/clearlooks/src/clearlooks_draw_gummy.c Sun Aug 10 20:18:04 2008
@@ -1393,6 +1393,13 @@
cairo_pattern_t *pt;
gboolean inconsistent;
gboolean draw_bullet = (checkbox->shadow_type == GTK_SHADOW_IN);
+ gdouble w, h, cx, cy, radius;
+
+ w = (gdouble) width;
+ h = (gdouble) height;
+ cx = width / 2.0;
+ cy = height / 2.0;
+ radius = MIN (width, height) / 2.0;
inconsistent = (checkbox->shadow_type == GTK_SHADOW_ETCHED_IN);
draw_bullet |= inconsistent;
@@ -1414,7 +1421,7 @@
ge_shade_color (&widget->parentbg, 0.9, &shadow);
ge_shade_color (&widget->parentbg, 1.1, &highlight);
- pt = cairo_pattern_create_linear (0, 0, 13, 13);
+ pt = cairo_pattern_create_linear (0, 0, radius * 2.0, radius * 2.0);
cairo_pattern_add_color_stop_rgb (pt, 0.0, shadow.r, shadow.b, shadow.g);
cairo_pattern_add_color_stop_rgba (pt, 0.5, shadow.r, shadow.b, shadow.g, 0.5);
cairo_pattern_add_color_stop_rgba (pt, 0.5, highlight.r, highlight.g, highlight.b, 0.5);
@@ -1422,15 +1429,15 @@
cairo_translate (cr, x, y);
- cairo_set_line_width (cr, 2);
- cairo_arc (cr, 7, 7, 6, 0, G_PI*2);
+ cairo_set_line_width (cr, MAX (1.0, floor (radius/3)));
+ cairo_arc (cr, ceil (cx), ceil (cy), floor (radius - 0.1), 0, G_PI*2);
cairo_set_source (cr, pt);
cairo_stroke (cr);
cairo_pattern_destroy (pt);
- cairo_set_line_width (cr, 1);
+ cairo_set_line_width (cr, MAX (1.0, floor (radius/6)));
- cairo_arc (cr, 7, 7, 5.5, 0, G_PI*2);
+ cairo_arc (cr, ceil (cx), ceil (cy), MAX (1.0, ceil (radius) - 1.5), 0, G_PI*2);
if (!widget->disabled)
{
@@ -1449,21 +1456,21 @@
if (inconsistent)
{
cairo_set_line_cap(cr, CAIRO_LINE_CAP_ROUND);
- cairo_set_line_width (cr, 4);
+ cairo_set_line_width (cr, ceil (radius * 2 / 3));
- cairo_move_to (cr, 5, 7);
- cairo_line_to (cr, 9, 7);
+ cairo_move_to (cr, ceil (cx - radius/3.0), ceil (cy));
+ cairo_line_to (cr, ceil (cx + radius/3.0), ceil (cy));
ge_cairo_set_color (cr, dot);
cairo_stroke (cr);
}
else
{
- cairo_arc (cr, 7, 7, 3, 0, G_PI*2);
+ cairo_arc (cr, ceil (cx), ceil (cy), floor (radius/2.0), 0, G_PI*2);
ge_cairo_set_color (cr, dot);
cairo_fill (cr);
- cairo_arc (cr, 6, 6, 1, 0, G_PI*2);
+ cairo_arc (cr, floor (cx - radius/10.0), floor (cy - radius/10.0), floor (radius/6.0), 0, G_PI*2);
cairo_set_source_rgba (cr, highlight.r, highlight.g, highlight.b, 0.5);
cairo_fill (cr);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]