summaryrefslogtreecommitdiff
path: root/gtk/gtkexpander.c
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2006-10-02 03:50:38 +0000
committerMatthias Clasen <matthiasc@src.gnome.org>2006-10-02 03:50:38 +0000
commitaab95f48a702903707897dbd6a68d27a6559ba9b (patch)
treefc83f287c317dd34261b717a56288760cdd92021 /gtk/gtkexpander.c
parentc247b1bc4a5e6e6ce5b875c72ff07cc162fe35cd (diff)
downloadgtk+-aab95f48a702903707897dbd6a68d27a6559ba9b.tar.gz
Make the event_window large enough to cover the full height of the
2006-10-01 Matthias Clasen <mclasen@redhat.com> * gtk/gtkexpander.c (gtk_expander_realize) (gtk_expander_size_allocate): Make the event_window large enough to cover the full height of the label_widget. (#358351, Scott Horowitz)
Diffstat (limited to 'gtk/gtkexpander.c')
-rw-r--r--gtk/gtkexpander.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gtk/gtkexpander.c b/gtk/gtkexpander.c
index a1a321d3cf..33333d5f12 100644
--- a/gtk/gtkexpander.c
+++ b/gtk/gtkexpander.c
@@ -370,6 +370,7 @@ gtk_expander_realize (GtkWidget *widget)
gint attributes_mask;
gint border_width;
GdkRectangle expander_rect;
+ gint label_height;
priv = GTK_EXPANDER (widget)->priv;
GTK_WIDGET_SET_FLAGS (widget, GTK_REALIZED);
@@ -378,11 +379,21 @@ gtk_expander_realize (GtkWidget *widget)
get_expander_bounds (GTK_EXPANDER (widget), &expander_rect);
+ if (priv->label_widget && GTK_WIDGET_VISIBLE (priv->label_widget))
+ {
+ GtkRequisition label_requisition;
+
+ gtk_widget_get_child_requisition (priv->label_widget, &label_requisition);
+ label_height = label_requisition.height;
+ }
+ else
+ label_height = 0;
+
attributes.window_type = GDK_WINDOW_CHILD;
attributes.x = widget->allocation.x + border_width;
- attributes.y = expander_rect.y;
+ attributes.y = widget->allocation.y + border_width;
attributes.width = MAX (widget->allocation.width - 2 * border_width, 1);
- attributes.height = expander_rect.width;
+ attributes.height = MAX (expander_rect.height, label_height - 2 * border_width);
attributes.wclass = GDK_INPUT_ONLY;
attributes.event_mask = gtk_widget_get_events (widget) |
GDK_BUTTON_PRESS_MASK |
@@ -636,8 +647,10 @@ gtk_expander_size_allocate (GtkWidget *widget,
get_expander_bounds (expander, &rect);
gdk_window_move_resize (priv->event_window,
- allocation->x + border_width, rect.y,
- MAX (allocation->width - 2 * border_width, 1), rect.width);
+ allocation->x + border_width,
+ allocation->y + border_width,
+ MAX (allocation->width - 2 * border_width, 1),
+ MAX (rect.height, label_height - 2 * border_width));
}
if (child_visible)