summaryrefslogtreecommitdiff
path: root/gtk/gtknotebook.c
diff options
context:
space:
mode:
authorBastien Nocera <hadess@hadess.net>2011-03-17 17:59:46 +0000
committerBastien Nocera <hadess@hadess.net>2011-03-17 18:30:40 +0000
commit90a4f8dc4b580de43b485276a108f91aa1587e2a (patch)
tree3946287152a5b96346172527d21289f72dfe44de /gtk/gtknotebook.c
parent58f0bc62a9015911e22784daf4144cd03b021f97 (diff)
downloadgtk+-90a4f8dc4b580de43b485276a108f91aa1587e2a.tar.gz
notebook: Don't set notebook style with hidden tabs
When tabs are not shown, and the notebook is used as a container, we should not set the notebook style, otherwise the theme has no way to know whether tabs are shown or not, and which colour to draw the background. https://bugzilla.gnome.org/show_bug.cgi?id=640692
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r--gtk/gtknotebook.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 8f6f34be92..94a078c09a 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -7100,6 +7100,7 @@ gtk_notebook_set_show_tabs (GtkNotebook *notebook,
{
GtkNotebookPrivate *priv;
GtkNotebookPage *page;
+ GtkStyleContext *context;
GList *children;
gint i;
@@ -7114,6 +7115,7 @@ gtk_notebook_set_show_tabs (GtkNotebook *notebook,
priv->show_tabs = show_tabs;
children = priv->children;
+ context = gtk_widget_get_style_context (GTK_WIDGET (notebook));
if (!show_tabs)
{
@@ -7131,11 +7133,14 @@ gtk_notebook_set_show_tabs (GtkNotebook *notebook,
else
gtk_widget_hide (page->tab_label);
}
+
+ gtk_style_context_remove_class (context, GTK_STYLE_CLASS_NOTEBOOK);
}
else
{
gtk_widget_set_can_focus (GTK_WIDGET (notebook), TRUE);
gtk_notebook_update_labels (notebook);
+ gtk_style_context_add_class (context, GTK_STYLE_CLASS_NOTEBOOK);
}
for (i = 0; i < N_ACTION_WIDGETS; i++)