1 --- gtk+-2.6.4/gtk/gtkseparatortoolitem.c 2004-08-09 19:59:52.000000000 +0300
2 +++ gtk+-2.6.4/gtk/gtkseparatortoolitem.c 2005-04-06 16:19:37.937770944 +0300
4 #include "gtktoolbar.h"
6 #define MENU_ID "gtk-separator-tool-item-menu-id"
7 +#define HILDON_SEPARATOR_HEIGHT 40
12 P_("Whether the separator is drawn, or just blank"),
15 + /* Hildon addition : some new style properties we need. */
16 + gtk_widget_class_install_style_property(widget_class,
17 + g_param_spec_int ("separator_size",
18 + P_("Separator size"), P_("The thickness of the separator. -1 for default behaviour."),
19 + -1, G_MAXINT, -1, G_PARAM_READWRITE));
21 + gtk_widget_class_install_style_property (widget_class,
22 + g_param_spec_boolean ("is_image",
23 + P_("Is separator an image or a line"),
24 + P_("Whether the separator is drawn as an image, or just as a line"),
26 + G_PARAM_READWRITE));
28 g_type_class_add_private (object_class, sizeof (GtkSeparatorToolItemPrivate));
31 GtkToolItem *item = GTK_TOOL_ITEM (widget);
32 GtkOrientation orientation = gtk_tool_item_get_orientation (item);
34 + /* Hildon modifications from here on:
35 + * if the "separator_size" style property
36 + * is the default value (it has not been set
37 + * in resource files), use default gtk+ behaviour.
39 + gint separator_size = -1;
41 + gtk_widget_style_get( widget, "separator_size", &separator_size, NULL );
43 + if (separator_size == -1)
44 + separator_size = get_space_size (item);
46 if (orientation == GTK_ORIENTATION_HORIZONTAL)
48 - requisition->width = get_space_size (item);
49 + requisition->width = separator_size;
50 requisition->height = 1;
54 - requisition->height = get_space_size (item);
55 + requisition->height = separator_size;
56 requisition->width = 1;
63 + gboolean is_image = FALSE;
64 if (widget->parent && GTK_IS_TOOLBAR (widget->parent))
65 toolbar = GTK_TOOLBAR (widget->parent);
67 - _gtk_toolbar_paint_space_line (widget, toolbar,
68 + gtk_widget_style_get( widget, "is_image", &is_image, NULL );
71 + gint separator_size = -1;
72 + GtkOrientation orientation = gtk_tool_item_get_orientation (GTK_TOOL_ITEM (widget));
74 + gtk_widget_style_get( widget, "separator_size", &separator_size, NULL );
76 + /* if style property not set, use gtk+
77 + * default behaviour. */
78 + if (separator_size == -1)
79 + separator_size = get_space_size (GTK_TOOL_ITEM (widget));
81 + gtk_paint_box( widget->style, widget->window, GTK_WIDGET_STATE(widget),
82 + GTK_SHADOW_NONE, &event->area, widget,
83 + orientation == GTK_ORIENTATION_HORIZONTAL ? "vertical" : "horizontal",
84 + widget->allocation.x, widget->allocation.y + (widget->allocation.height - HILDON_SEPARATOR_HEIGHT) / 2,
85 + separator_size, HILDON_SEPARATOR_HEIGHT );
87 + _gtk_toolbar_paint_space_line (widget, toolbar,
88 &(event->area), &widget->allocation);