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);
     }
   }
