summaryrefslogtreecommitdiff
path: root/gtk/gtkstatusbar.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2004-11-09 07:27:40 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2004-11-09 07:27:40 +0000
commit84407935506cc21940addbd75e2e815dd465f012 (patch)
tree3922308164ce796321d91e5f660d9956094de053 /gtk/gtkstatusbar.c
parentdd3948538b956d2f22d71d2cacfe5bfbc16de35a (diff)
downloadgdk-pixbuf-84407935506cc21940addbd75e2e815dd465f012.tar.gz
Apply a patch by Owen Taylor to get reasonable allocations for the
2004-11-09 Matthias Clasen <mclasen@redhat.com> * gtk/gtkstatusbar.c: Apply a patch by Owen Taylor to get reasonable allocations for the statusbar and its children. (#73359)
Diffstat (limited to 'gtk/gtkstatusbar.c')
-rw-r--r--gtk/gtkstatusbar.c40
1 files changed, 8 insertions, 32 deletions
diff --git a/gtk/gtkstatusbar.c b/gtk/gtkstatusbar.c
index 4f3ffc355..e14ccfeb5 100644
--- a/gtk/gtkstatusbar.c
+++ b/gtk/gtkstatusbar.c
@@ -526,10 +526,10 @@ get_grip_rect (GtkStatusbar *statusbar,
w = 18;
h = 18;
- if (w > (widget->allocation.width))
+ if (w > widget->allocation.width)
w = widget->allocation.width;
- if (h > (widget->allocation.height - widget->style->ythickness))
+ if (h > widget->allocation.height - widget->style->ythickness)
h = widget->allocation.height - widget->style->ythickness;
rect->width = w;
@@ -591,6 +591,7 @@ gtk_statusbar_create_window (GtkStatusbar *statusbar)
statusbar->grip_window = gdk_window_new (widget->window,
&attributes, attributes_mask);
+
gdk_window_set_user_data (statusbar->grip_window, widget);
set_grip_cursor (statusbar);
@@ -753,19 +754,6 @@ gtk_statusbar_size_request (GtkWidget *widget,
gtk_frame_set_shadow_type (GTK_FRAME (statusbar->frame), shadow_type);
GTK_WIDGET_CLASS (parent_class)->size_request (widget, requisition);
-
- if (statusbar->has_resize_grip)
- {
- GdkRectangle rect;
-
- /* x, y in the grip rect depend on size allocation, but
- * w, h do not so this is OK
- */
- get_grip_rect (statusbar, &rect);
-
- requisition->width += rect.width;
- requisition->height = MAX (requisition->height, rect.height);
- }
}
static void
@@ -776,30 +764,18 @@ gtk_statusbar_size_allocate (GtkWidget *widget,
statusbar = GTK_STATUSBAR (widget);
- if (statusbar->has_resize_grip)
+ /* chain up normally */
+ GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
+
+ if (statusbar->has_resize_grip && statusbar->grip_window)
{
GdkRectangle rect;
- GtkRequisition saved_req;
- widget->allocation = *allocation; /* get_grip_rect needs this info */
get_grip_rect (statusbar, &rect);
- if (statusbar->grip_window)
gdk_window_move_resize (statusbar->grip_window,
rect.x, rect.y,
rect.width, rect.height);
-
- /* enter the bad hack zone */
- saved_req = widget->requisition;
- widget->requisition.width -= rect.width; /* HBox::size_allocate needs this */
- if (widget->requisition.width < 0)
- widget->requisition.width = 0;
- GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
- widget->requisition = saved_req;
- }
- else
- {
- /* chain up normally */
- GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation);
}
}
+