[gtk-engines] Implement inconsistent button as suggested by Calum (bug #502165)
- From: Benjamin Berg <bberg src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk-engines] Implement inconsistent button as suggested by Calum (bug #502165)
- Date: Sat, 2 Jan 2010 15:12:34 +0000 (UTC)
commit ce1c738d5ef8081d098cec19ef3de7c1fad7bdab
Author: Benjamin Berg <benjamin sipsolutions net>
Date: Sat Jan 2 16:11:49 2010 +0100
Implement inconsistent button as suggested by Calum (bug #502165)
This means that inconsistent buttons will be drawn half in the normal
and the other half in the pressed state.
engines/clearlooks/src/clearlooks_style.c | 37 +++++++++++++++++++++++++----
1 files changed, 32 insertions(+), 5 deletions(-)
---
diff --git a/engines/clearlooks/src/clearlooks_style.c b/engines/clearlooks/src/clearlooks_style.c
index eec7cee..97ff857 100644
--- a/engines/clearlooks/src/clearlooks_style.c
+++ b/engines/clearlooks/src/clearlooks_style.c
@@ -581,7 +581,6 @@ clearlooks_style_draw_box (DRAW_ARGS)
{
WidgetParameters params;
- ShadowParameters shadow = { CR_CORNER_ALL, CL_SHADOW_NONE } ;
clearlooks_set_widget_parameters (widget, style, state_type, ¶ms);
params.active = shadow_type == GTK_SHADOW_IN;
@@ -592,8 +591,6 @@ clearlooks_style_draw_box (DRAW_ARGS)
else
params.corners = CR_CORNER_TOPLEFT | CR_CORNER_BOTTOMLEFT;
- shadow.shadow = CL_SHADOW_IN;
-
if (params.xthickness > 2)
{
if (params.ltr)
@@ -608,8 +605,38 @@ clearlooks_style_draw_box (DRAW_ARGS)
params.enable_shadow = TRUE;
}
- STYLE_FUNCTION(draw_button) (cr, &clearlooks_style->colors, ¶ms,
- x, y, width, height);
+ if (shadow_type != GTK_SHADOW_ETCHED_IN)
+ {
+ STYLE_FUNCTION(draw_button) (cr, &clearlooks_style->colors, ¶ms,
+ x, y, width, height);
+ }
+ else
+ {
+ g_print ("ETCHED IN\n");
+ cairo_save (cr);
+ cairo_move_to (cr, x, y);
+ cairo_line_to (cr, x + width, y);
+ cairo_line_to (cr, x, y + height);
+ cairo_close_path (cr);
+ cairo_clip (cr);
+ params.active = TRUE;
+ params.state_type = GTK_STATE_ACTIVE;
+ STYLE_FUNCTION(draw_button) (cr, &clearlooks_style->colors, ¶ms,
+ x, y, width, height);
+ cairo_restore (cr);
+
+ cairo_save (cr);
+ cairo_move_to (cr, x + width, y);
+ cairo_line_to (cr, x + width, y + height);
+ cairo_line_to (cr, x, y + height);
+ cairo_close_path (cr);
+ cairo_clip (cr);
+ params.active = FALSE;
+ params.state_type = GTK_STATE_NORMAL;
+ STYLE_FUNCTION(draw_button) (cr, &clearlooks_style->colors, ¶ms,
+ x, y, width, height);
+ cairo_restore (cr);
+ }
}
else if (DETAIL ("spinbutton_up") || DETAIL ("spinbutton_down"))
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]