[gtk+/wip/otte/gadget: 16/30] notebook: Set active state properly
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/otte/gadget: 16/30] notebook: Set active state properly
- Date: Sun, 11 Oct 2015 18:19:47 +0000 (UTC)
commit 663ea75307ca7a0a76e01dc36a934b9776b731dd
Author: Benjamin Otte <otte redhat com>
Date: Mon Sep 7 11:39:55 2015 +0200
notebook: Set active state properly
Don't update it on save/restore, actually set it when it changes.
gtk/gtknotebook.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 5be9136..bc45bed 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]