summaryrefslogtreecommitdiff
path: root/gtk/gtkseparatortoolitem.c
diff options
context:
space:
mode:
authorSoeren Sandmann <sandmann@daimi.au.dk>2003-07-08 18:20:45 +0000
committerSøren Sandmann Pedersen <ssp@src.gnome.org>2003-07-08 18:20:45 +0000
commit7913e63f692a7f7b155fe07246d69c58f4087688 (patch)
treeba5fed8f6268c7afd187dcb6a1f34270672957f4 /gtk/gtkseparatortoolitem.c
parentb3b16bebcf3a28475190b764091442e7be18fdb2 (diff)
downloadgtk+-7913e63f692a7f7b155fe07246d69c58f4087688.tar.gz
remove correction on x when detail is "menuitem". With the new menu look
Tue Jul 8 19:57:14 2003 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtkstyle.c (gtk_default_draw_arrow): remove correction on x when detail is "menuitem". With the new menu look is isn't needed anymore. * gtk/gtktoolitem.c (gtk_tool_item_toolbar_reconfigured): queue a resize here, so that tool items will get a chance to relayout themselves based on the toolbar configuration. change DEFAULT_SPACE_SIZE to 4 instead of 5 * gtk/gtktoolbar.c Get rid of "!GTK_BIN (item)->child means separator". Separators are widgets in their own right change DEFAULT_SPACE_SIZE to 4 instead of 5 (get_space_size): remove this function (toolbar_item_is_homogeneous): new function * gtk/gtkseparatortoolitem.c (gtk_separator_tool_item_size_request): new function. Tue Jul 8 14:10:35 2003 Soeren Sandmann <sandmann@daimi.au.dk> * gtk/gtktoggletoolbutton.h: use private data, add new internal function _gtk_toggle_tool_button_get_button() * gtk/gtktoolbutton.h: move to private data * gtk/gtkradiotoolbutton.c, gtk/gtktoolbutton.c: updates for new private data.
Diffstat (limited to 'gtk/gtkseparatortoolitem.c')
-rw-r--r--gtk/gtkseparatortoolitem.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/gtk/gtkseparatortoolitem.c b/gtk/gtkseparatortoolitem.c
index b7b1a60b1f..0f1e3ad9ec 100644
--- a/gtk/gtkseparatortoolitem.c
+++ b/gtk/gtkseparatortoolitem.c
@@ -27,7 +27,7 @@
#include "gtktoolbar.h"
/* note: keep in sync with DEFAULT_SPACE_SIZE and DEFAULT_SPACE_STYLE in gtktoolbar.c */
-#define DEFAULT_SPACE_SIZE 5
+#define DEFAULT_SPACE_SIZE 4
#define DEFAULT_SPACE_STYLE GTK_TOOLBAR_SPACE_LINE
#define SPACE_LINE_DIVISION 10
@@ -35,6 +35,8 @@
#define SPACE_LINE_END 7
static void gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class);
+static void gtk_separator_tool_item_size_request (GtkWidget *widget,
+ GtkRequisition *requisition);
static gboolean gtk_separator_tool_item_expose (GtkWidget *widget,
GdkEventExpose *event);
static void gtk_separator_tool_item_add (GtkContainer *container,
@@ -115,6 +117,7 @@ gtk_separator_tool_item_class_init (GtkSeparatorToolItemClass *class)
toolitem_class = (GtkToolItemClass *)class;
widget_class = (GtkWidgetClass *)class;
+ widget_class->size_request = gtk_separator_tool_item_size_request;
widget_class->expose_event = gtk_separator_tool_item_expose;
container_class->add = gtk_separator_tool_item_add;
@@ -127,6 +130,25 @@ gtk_separator_tool_item_add (GtkContainer *container,
g_warning("attempt to add a child to an GtkSeparatorToolItem");
}
+static void
+gtk_separator_tool_item_size_request (GtkWidget *widget,
+ GtkRequisition *requisition)
+{
+ GtkToolItem *item = GTK_TOOL_ITEM (widget);
+ GtkOrientation orientation = gtk_tool_item_get_orientation (item);
+
+ if (orientation == GTK_ORIENTATION_HORIZONTAL)
+ {
+ requisition->width = get_space_size (item);
+ requisition->height = 1;
+ }
+ else
+ {
+ requisition->height = get_space_size (item);
+ requisition->width = 1;
+ }
+}
+
static gboolean
gtk_separator_tool_item_expose (GtkWidget *widget,
GdkEventExpose *event)
@@ -143,7 +165,7 @@ gtk_separator_tool_item_expose (GtkWidget *widget,
allocation = &(widget->allocation);
orientation = gtk_tool_item_get_orientation (tool_item);
area = &(event->area);
-
+
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
gtk_paint_vline (widget->style, widget->window,