[gtk+/widget-expand-3] Queue an expand recompute if scrollbar visibility changes
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/widget-expand-3] Queue an expand recompute if scrollbar visibility changes
- Date: Mon, 11 Oct 2010 23:47:56 +0000 (UTC)
commit ffd079a411e82a71d5076996fa95f3c4dbef70de
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 11 19:46:48 2010 -0400
Queue an expand recompute if scrollbar visibility changes
gtk/gtkscrolledwindow.c | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 2686616..2e5c835 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -1392,7 +1392,9 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
gboolean scrollbars_within_bevel;
gint scrollbar_spacing;
guint border_width;
-
+ gboolean hscrollbar_was_visible;
+ gboolean vscrollbar_was_visible;
+
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (widget));
g_return_if_fail (allocation != NULL);
@@ -1409,6 +1411,9 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
gtk_widget_set_allocation (widget, allocation);
+ hscrollbar_was_visible = priv->hscrollbar_visible;
+ vscrollbar_was_visible = priv->vscrollbar_visible;
+
if (priv->hscrollbar_policy == GTK_POLICY_ALWAYS)
priv->hscrollbar_visible = TRUE;
else if (priv->hscrollbar_policy == GTK_POLICY_NEVER)
@@ -1449,6 +1454,10 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
priv->hscrollbar_visible = TRUE;
priv->vscrollbar_visible = TRUE;
+ if (hscrollbar_was_visible != priv->hscrollbar_visible ||
+ vscrollbar_was_visible != priv->vscrollbar_visible)
+ gtk_widget_queue_compute_expand (widget);
+
/* a new resize is already queued at this point,
* so we will immediatedly get reinvoked
*/
@@ -1467,6 +1476,10 @@ gtk_scrolled_window_size_allocate (GtkWidget *widget,
gtk_scrolled_window_relative_allocation (widget, &relative_allocation);
}
+ if (hscrollbar_was_visible != priv->hscrollbar_visible ||
+ vscrollbar_was_visible != priv->vscrollbar_visible)
+ gtk_widget_queue_compute_expand (widget);
+
if (priv->hscrollbar_visible)
{
GtkRequisition hscrollbar_requisition;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]