[gtk+] notebook: update tab area allocation when switching page
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] notebook: update tab area allocation when switching page
- Date: Mon, 24 Oct 2011 17:47:18 +0000 (UTC)
commit ccdc3c18028925565f252e7259aefe2b27e3ec2e
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Oct 24 13:12:21 2011 -0400
notebook: update tab area allocation when switching page
When the active page is switched, it's important
gtk_notebook_pages_allocate() is called after the bulk of
gtk_notebook_real_switch_page() is run, as the former allocates a
different space according to the currently active tab, which is set by
the latter.
gtk_notebook_pages_allocate() already calls gtk_notebook_redraw_tabs()
when the allocation changes, so just move its call down to
gtk_notebook_real_switch_page() to fix the bug.
https://bugzilla.gnome.org/show_bug.cgi?id=662629
gtk/gtknotebook.c | 7 ++-----
1 files changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index a6bf731..86595ad 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -6497,6 +6497,8 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
}
gtk_notebook_update_tab_states (notebook);
+ gtk_notebook_pages_allocate (notebook);
+
gtk_widget_queue_resize (GTK_WIDGET (notebook));
g_object_notify (G_OBJECT (notebook), "page");
}
@@ -6585,11 +6587,6 @@ gtk_notebook_switch_focus_tab (GtkNotebook *notebook,
return;
page = priv->focus_tab->data;
- if (gtk_widget_get_mapped (page->tab_label))
- gtk_notebook_redraw_tabs (notebook);
- else
- gtk_notebook_pages_allocate (notebook);
-
gtk_notebook_switch_page (notebook, page);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]