[patch] a nicer tearoffmenuitem



Hi,

Attached is a short patch that replaces the (in my eyes) ugly horizontal line
used for tearoff menus with something that resembles more to a handle (it fact
it is one). I haven't committed it instantly since some people might not like 
that it uses a little more space. Please commit it if you like it...


Salut, Sven

--- gtktearoffmenuitem.c.orig	Mon Dec 21 02:22:20 1998
+++ gtktearoffmenuitem.c	Mon Dec 21 02:23:02 1998
@@ -21,7 +21,6 @@
 #include "gtktearoffmenuitem.h"
 
 #define ARROW_SIZE 10
-#define TEAR_LENGTH 5
 #define BORDER_SPACING  3
 
 static void gtk_tearoff_menu_item_class_init (GtkTearoffMenuItemClass *klass);
@@ -105,14 +104,7 @@
   requisition->height = (GTK_CONTAINER (widget)->border_width +
 			 widget->style->klass->ythickness) * 2;
 
-  if (tearoff->torn_off)
-    {
-      requisition->height += ARROW_SIZE;
-    }
-  else
-    {
-      requisition->height += widget->style->klass->ythickness;
-    }
+  requisition->height += ARROW_SIZE;
 }
 
 static void
@@ -176,13 +168,10 @@
 			  ARROW_SIZE, ARROW_SIZE);
 	}
 
-      while (x < right_max)
-	{
-	  gtk_draw_hline (widget->style, widget->window, GTK_STATE_NORMAL,
-			  x, MIN (x+TEAR_LENGTH, right_max),
-			  y + (height - widget->style->klass->ythickness)/2);
-	  x += 2 * TEAR_LENGTH;
-	}
+      gtk_draw_handle (widget->style, widget->window, GTK_STATE_NORMAL, GTK_SHADOW_NONE,
+		       x, y + height / 2 - 5, 
+		       right_max - ( x + BORDER_SPACING), ARROW_SIZE, 
+		       GTK_ORIENTATION_HORIZONTAL);  
     }
 }
 


 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]