diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2013-08-05 11:17:08 +0200 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2013-09-26 19:19:53 -0400 |
commit | a2ed88b3eebfb99ebe8bd41ffa1ed7fa7d597f71 (patch) | |
tree | b611c120621683cc5858e858d5121e99cce10315 /gtk/gtknotebook.c | |
parent | bd1df337982ce274b67df745f205677ab8fded91 (diff) | |
download | gtk+-a2ed88b3eebfb99ebe8bd41ffa1ed7fa7d597f71.tar.gz |
Allow active tab children to be styled
This allows one to style the children of an active
tab label from CSS.
https://bugzilla.gnome.org/show_bug.cgi?id=691163
Diffstat (limited to 'gtk/gtknotebook.c')
-rw-r--r-- | gtk/gtknotebook.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index d1f629c0fa..27880c49f9 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -4934,6 +4934,9 @@ gtk_notebook_real_remove (GtkNotebook *notebook, if (priv->cur_page == list->data) { + if (priv->cur_page->tab_label) + gtk_style_context_remove_class (gtk_widget_get_style_context (priv->cur_page->tab_label), + "active-page"); priv->cur_page = NULL; if (next_list && !destroying) gtk_notebook_switch_page (notebook, GTK_NOTEBOOK_PAGE (next_list)); @@ -6543,9 +6546,17 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook, child_has_focus = priv->child_has_focus; if (priv->cur_page) - gtk_widget_set_child_visible (priv->cur_page->child, FALSE); + { + gtk_widget_set_child_visible (priv->cur_page->child, FALSE); + if (priv->cur_page->tab_label) + gtk_style_context_remove_class (gtk_widget_get_style_context (priv->cur_page->tab_label), + "active-page"); + } priv->cur_page = page; + if (page->tab_label) + gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label), + "active-page"); if (!priv->focus_tab || priv->focus_tab->data != (gpointer) priv->cur_page) |