Package: gtk2-engines-cleanice / 2.4.1-3

02-draw-arrow-fixes Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
Description: make arrow drawing more consistent
 This patch removes unused shadowing code for all arrows
 and fixes the placement of arrows inside their widgets.
Author: <juergen.mangler@univie.ac.at>
Last-Update: 2010-05-16

--- gtk2-engines-cleanice-2.4.1.orig/src/cleanice-draw.c	2010-05-16 17:22:50.000000000 +0400
+++ gtk2-engines-cleanice-2.4.1/src/cleanice-draw.c	2010-05-16 17:25:34.000000000 +0400
@@ -570,7 +570,6 @@
 			      GdkRectangle  *area,
 			      GtkStateType   state_type,
 			      GtkArrowType   arrow_type,
-			      GtkShadowType  shadow_type,
 			      gboolean       fill,
 			      gint           x,
 			      gint           y,
@@ -592,29 +591,6 @@
       gdk_draw_line (window, gc, x + (width - 1) / 2, y + height - 1,
 		     x + width - 1, y);
     }
-    switch (shadow_type) {
-    case GTK_SHADOW_IN:
-    case GTK_SHADOW_ETCHED_IN:
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x, y, x + width - 1, y);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x, y, x + (width - 1) / 2, y + height - 1);
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x + (width - 1) / 2, y + height - 1, x + width - 1, y);
-      break;
-    case GTK_SHADOW_OUT:
-    case GTK_SHADOW_ETCHED_OUT:
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x, y, x + width - 1, y);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x, y, x + (width - 1) / 2, y + height - 1);
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x + (width - 1) / 2, y + height - 1, x + width - 1, y);
-      break;
-
-    case GTK_SHADOW_NONE:
-      break;
-    }
     break;
   case GTK_ARROW_UP:
     if (fill) {
@@ -628,29 +604,6 @@
       gdk_draw_line (window, gc, x + (width - 1) / 2, y,
 		     x + width - 1, y + height - 1);
     }
-    switch (shadow_type) {
-    case GTK_SHADOW_IN:
-    case GTK_SHADOW_ETCHED_IN:
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x, y + height - 1, x + width - 1, y + height - 1);
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x + (width - 1) / 2, y, x, y + height - 1);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x + (width - 1) / 2, y, x + width - 1, y + height - 1);
-      break;
-    case GTK_SHADOW_OUT:
-    case GTK_SHADOW_ETCHED_OUT:
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x, y + height - 1, x + width - 1, y + height - 1);
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x + (width - 1) / 2, y, x, y + height - 1);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x + (width - 1) / 2, y, x + width - 1, y + height - 1);
-      break;
-
-    case GTK_SHADOW_NONE:
-      break;
-    }
     break;
   case GTK_ARROW_LEFT:
     if (fill) {
@@ -665,30 +618,6 @@
 		     x + width - 1, y + height - 1);
     }
     break;
-    switch (shadow_type) {
-    case GTK_SHADOW_IN:
-    case GTK_SHADOW_ETCHED_IN:
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x + width - 1, y, x + width - 1, y + height - 1);
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x, y + (height - 1) / 2, x + width - 1, y);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x, y + (height - 1) / 2, x + width - 1, y + height - 1);
-      break;
-    case GTK_SHADOW_OUT:
-    case GTK_SHADOW_ETCHED_OUT:
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x + width - 1, y, x + width - 1, y + height - 1);
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x, y + (height - 1) / 2, x + width - 1, y);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x, y + (height - 1) / 2, x + width - 1, y + height - 1);
-      break;
-
-    case GTK_SHADOW_NONE:
-      break;
-    }
-    break;
   case GTK_ARROW_RIGHT:
     if (fill) {
       for (i = 0, j = 0; i < width; i++, j++)
@@ -699,29 +628,6 @@
       gdk_draw_line (window, gc, x, y + height - 1,
 		     x + width - 1, y + (height - 1) / 2);
     }
-    switch (shadow_type) {
-    case GTK_SHADOW_IN:
-    case GTK_SHADOW_ETCHED_IN:
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x, y, x, y + height - 1);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x, y, x + width - 1, y + (height - 1) / 2);
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x, y + height - 1, x + width - 1, y + (height - 1) / 2);
-      break;
-    case GTK_SHADOW_OUT:
-    case GTK_SHADOW_ETCHED_OUT:
-      gdk_draw_line (window, widget->style->light_gc[state_type],
-		     x, y, x, y + height - 1);
-      gdk_draw_line (window, widget->style->mid_gc[state_type],
-		     x, y, x + width - 1, y + (height - 1) / 2);
-      gdk_draw_line (window, widget->style->dark_gc[state_type],
-		     x, y + height - 1, x + width - 1, y + (height - 1) / 2);
-      break;
- 
-    case GTK_SHADOW_NONE:
-      break;
-    }
     break;
   }
 
@@ -752,19 +658,6 @@
 
   calculate_arrow_geometry (arrow_type, &ax, &ay, &aw, &ah);
 
-  /*
-     GTK+ sucks at drawing arrows, or telling itself what to draw in
-     some cases, and so we must do this stupid lame hack, so that the
-     arrows in CleanIce draw correctly
-  */
-  if (DETAIL ("vscrollbar") || DETAIL ("hscrollbar") ||
-      DETAIL ("spinbutton") || DETAIL ("notebook") ||
-      DETAIL ("calendar") || DETAIL ("menuitem") ||
-      DETAIL ("tearoffmenuitem") || DETAIL ("header") ||
-      DETAIL ("menu_scroll_arrow_up") || DETAIL ("menu_scroll_arrow_down") ||
-      widget->parent->parent && GTK_IS_COMBO (widget->parent->parent))
-    shadow_type = GTK_SHADOW_NONE;
-
   if (DETAIL ("vscrollbar")) {
     ax -= (width % 2);
     aw += 2;
@@ -793,24 +686,24 @@
   switch (arrow_type) {
   case GTK_ARROW_UP:
   case GTK_ARROW_DOWN:
-    if (aw < 5) aw = 5;
-    if (ah < 3) ah = 3;
+    if (aw < 7) aw = 7;
+    if (ah < 4) ah = 4;
     break;
   case GTK_ARROW_RIGHT:
   case GTK_ARROW_LEFT:
-    if (aw < 3) aw = 3;
-    if (ah < 5) ah = 5;
+    if (aw < 4) aw = 4;
+    if (ah < 7) ah = 7;
     break;
   } 
 
   if (DETAIL ("expander") && state_type == GTK_STATE_PRELIGHT) {
     draw_black_arrow (window, widget, style->bg_gc[state_type], area,
-		      state_type, arrow_type, shadow_type,
+		      state_type, arrow_type,
 		      fill, ax, ay, aw, ah);
   } else if (DETAIL ("treeview") && state_type == GTK_STATE_SELECTED &&
 	     !GTK_WIDGET_HAS_FOCUS (widget)) {
     draw_black_arrow (window, widget, style->text_gc[GTK_STATE_ACTIVE], area,
-		      state_type, arrow_type, shadow_type,
+		      state_type, arrow_type,
 		      fill, ax, ay, aw, ah);
   } else {
     if ((widget->parent->parent &&
@@ -820,14 +713,14 @@
 	 GTK_IS_COMBO_BOX (widget->parent->parent->parent) &&
 	 !GTK_IS_COMBO_BOX_ENTRY (widget->parent->parent->parent))) {
       draw_black_arrow (window, widget->parent, style->fg_gc[state_type], area,
-			state_type, GTK_ARROW_UP, shadow_type,
+			state_type, GTK_ARROW_UP,
 			fill, ax, ay - ah / 2 - 1, aw, ah);
       draw_black_arrow (window, widget->parent, style->fg_gc[state_type], area,
-			state_type, GTK_ARROW_DOWN, shadow_type,
+			state_type, GTK_ARROW_DOWN,
 			fill, ax, ay + ah / 2 + 1, aw, ah);
     } else {
       draw_black_arrow (window, widget, style->fg_gc[state_type], area,
-			state_type, arrow_type, shadow_type,
+			state_type, arrow_type,
 			fill, ax, ay, aw, ah);
     }
   }