notebook: Set active state properly

Don't update it on save/restore, actually set it when it changes.
This commit is contained in:
Benjamin Otte 2015-09-07 11:39:55 +02:00
parent 541926089a
commit a4e86341e4

View File

@ -2033,8 +2033,6 @@ notebook_save_context_for_tab (GtkNotebook *notebook,
if (page != NULL)
{
if (page == notebook->priv->cur_page)
state |= GTK_STATE_FLAG_ACTIVE;
if (page->reorderable)
gtk_style_context_add_class (context, "reorderable-page");
}
@ -6743,12 +6741,16 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
if (priv->cur_page)
{
gtk_widget_set_child_visible (priv->cur_page->child, FALSE);
gtk_css_node_set_state (priv->cur_page->cssnode,
gtk_css_node_get_state (priv->cur_page->cssnode) & ~GTK_STATE_FLAG_ACTIVE);
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;
gtk_css_node_set_state (page->cssnode,
gtk_css_node_get_state (page->cssnode) | GTK_STATE_FLAG_ACTIVE);
if (page->tab_label)
gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label),
"active-page");