[gtk+] paned: Properly hide panes that were set to invisible
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] paned: Properly hide panes that were set to invisible
- Date: Sat, 4 Jun 2011 19:18:17 +0000 (UTC)
commit 0ba14bb2567ddc97757aac3f7c06413d44cc26ea
Author: Benjamin Otte <otte redhat com>
Date: Thu Jun 2 22:06:15 2011 +0200
paned: Properly hide panes that were set to invisible
Gets rid of random windows when hiding the Totem statusbar.
gtk/gtkpaned.c | 20 +++++++++++++++-----
1 files changed, 15 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkpaned.c b/gtk/gtkpaned.c
index 85c4200..e7b334a 100644
--- a/gtk/gtkpaned.c
+++ b/gtk/gtkpaned.c
@@ -1224,11 +1224,6 @@ gtk_paned_size_allocate (GtkWidget *widget,
if (gtk_widget_get_realized (widget))
gdk_window_hide (priv->handle);
- if (priv->child1)
- gtk_paned_set_child_visible (paned, 0, TRUE);
- if (priv->child2)
- gtk_paned_set_child_visible (paned, 1, TRUE);
-
window_allocation.x = allocation->x;
window_allocation.y = allocation->y;
window_allocation.width = allocation->width;
@@ -1239,6 +1234,10 @@ gtk_paned_size_allocate (GtkWidget *widget,
if (priv->child1 && gtk_widget_get_visible (priv->child1))
{
+ gtk_paned_set_child_visible (paned, 0, TRUE);
+ if (priv->child2)
+ gtk_paned_set_child_visible (paned, 1, FALSE);
+
gtk_paned_child_allocate (priv->child1,
priv->child1_window,
&window_allocation,
@@ -1246,11 +1245,22 @@ gtk_paned_size_allocate (GtkWidget *widget,
}
else if (priv->child2 && gtk_widget_get_visible (priv->child2))
{
+ gtk_paned_set_child_visible (paned, 1, TRUE);
+ if (priv->child1)
+ gtk_paned_set_child_visible (paned, 0, FALSE);
+
gtk_paned_child_allocate (priv->child2,
priv->child2_window,
&window_allocation,
&child_allocation);
}
+ else
+ {
+ if (priv->child1)
+ gtk_paned_set_child_visible (paned, 0, FALSE);
+ if (priv->child2)
+ gtk_paned_set_child_visible (paned, 1, FALSE);
+ }
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]