diff options
author | Soeren Sandmann <sandmann@daimi.au.dk> | 2003-07-18 16:25:31 +0000 |
---|---|---|
committer | Søren Sandmann Pedersen <ssp@src.gnome.org> | 2003-07-18 16:25:31 +0000 |
commit | 80560b9d3dc597ec0db1acb94f9d08a0ac192b51 (patch) | |
tree | f32b9622a70135df6cb42bcace0ed9a623891fc5 /gtk/gtktoolbutton.c | |
parent | 62a7160df0c8891cdc0a8ed88d3abb1b934cb236 (diff) | |
download | gtk+-80560b9d3dc597ec0db1acb94f9d08a0ac192b51.tar.gz |
By popular request give toolbuttons a border.
Fri Jul 18 18:43:01 2003 Soeren Sandmann <sandmann@daimi.au.dk>
By popular request give toolbuttons a border.
* gtk/gtktoolitem.c
(gtk_tool_item_size_allocate):
(gtk_tool_item_size_request): don't request and allocate a border
around the child
* gtk/gtktoolbutton.c
(gtk_tool_button_size_allocate):
(gtk_tool_button_size_request): remove these functions
* gtk/gtktoolbar.c
(gtk_toolbar_size_request):
(gtk_toolbar_size_allocate): request and allocate a border if we
have a shadow.
Diffstat (limited to 'gtk/gtktoolbutton.c')
-rw-r--r-- | gtk/gtktoolbutton.c | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/gtk/gtktoolbutton.c b/gtk/gtktoolbutton.c index 23199edd87..cb46fbdb1c 100644 --- a/gtk/gtktoolbutton.c +++ b/gtk/gtktoolbutton.c @@ -54,10 +54,6 @@ enum { static void gtk_tool_button_init (GtkToolButton *button, GtkToolButtonClass *klass); static void gtk_tool_button_class_init (GtkToolButtonClass *klass); -static void gtk_tool_button_size_request (GtkWidget *widget, - GtkRequisition *requisition); -static void gtk_tool_button_size_allocate (GtkWidget *widget, - GtkAllocation *allocation); static void gtk_tool_button_set_property (GObject *object, guint prop_id, const GValue *value, @@ -134,9 +130,6 @@ gtk_tool_button_class_init (GtkToolButtonClass *klass) object_class->get_property = gtk_tool_button_get_property; object_class->finalize = gtk_tool_button_finalize; - widget_class->size_request = gtk_tool_button_size_request; - widget_class->size_allocate = gtk_tool_button_size_allocate; - tool_item_class->create_menu_proxy = gtk_tool_button_create_menu_proxy; tool_item_class->toolbar_reconfigured = gtk_tool_button_toolbar_reconfigured; @@ -242,56 +235,6 @@ gtk_tool_button_init (GtkToolButton *button, } static void -gtk_tool_button_size_request (GtkWidget *widget, - GtkRequisition *requisition) -{ - GtkWidget *child = GTK_BIN (widget)->child; - - if (child && GTK_WIDGET_VISIBLE (child)) - { - gtk_widget_size_request (child, requisition); - } - else - { - requisition->width = 0; - requisition->height = 0; - } - - requisition->width += GTK_CONTAINER (widget)->border_width * 2; - requisition->height += GTK_CONTAINER (widget)->border_width * 2; -} - -static void -gtk_tool_button_size_allocate (GtkWidget *widget, - GtkAllocation *allocation) -{ - GtkToolItem *toolitem = GTK_TOOL_ITEM (widget); - GtkAllocation child_allocation; - gint border_width; - GtkWidget *child = GTK_BIN (widget)->child; - - widget->allocation = *allocation; - border_width = GTK_CONTAINER (widget)->border_width; - - if (gtk_tool_item_get_use_drag_window (toolitem) && GTK_WIDGET_REALIZED (widget)) - gdk_window_move_resize (_gtk_tool_item_get_drag_window (toolitem), - widget->allocation.x + border_width, - widget->allocation.y + border_width, - widget->allocation.width - border_width * 2, - widget->allocation.height - border_width * 2); - - if (child && GTK_WIDGET_VISIBLE (child)) - { - child_allocation.x = allocation->x + border_width; - child_allocation.y = allocation->y + border_width; - child_allocation.width = allocation->width - 2 * border_width; - child_allocation.height = allocation->height - 2 * border_width; - - gtk_widget_size_allocate (child, &child_allocation); - } -} - -static void gtk_tool_button_construct_contents (GtkToolItem *tool_item) { GtkToolButton *button = GTK_TOOL_BUTTON (tool_item); |