notebook: Remove "active-page" class

Instead, just use the "tab:active" selector
This commit is contained in:
Benjamin Otte 2015-09-07 12:26:33 +02:00
parent 2720d97db3
commit 182f9a7f39
6 changed files with 51 additions and 64 deletions

View File

@ -4970,9 +4970,6 @@ 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));
@ -6631,17 +6628,11 @@ gtk_notebook_real_switch_page (GtkNotebook *notebook,
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");
if (!priv->focus_tab ||
priv->focus_tab->data != (gpointer) priv->cur_page)
@ -7813,10 +7804,6 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook,
G_CALLBACK (gtk_notebook_mnemonic_activate_switch_page),
notebook);
if (priv->cur_page == page)
gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label),
"active-page");
if (priv->prelight_tab == page)
gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label),
"prelight-page");

View File

@ -1703,7 +1703,7 @@ column-header.button.dnd { // for treeview-like derive widgets
&:hover, &.prelight-page {
border-color: $borders_color;
}
&:active, &.active-page, &:backdrop:active {
&:active, &:backdrop:active {
border-color: $selected_bg_color;
}
&:backdrop {
@ -1721,7 +1721,7 @@ column-header.button.dnd { // for treeview-like derive widgets
border-#{$_border}-color: $borders_color;
background-color: transparentize($bg_color,0.8);
}
&:active, &.active-page {
&:active {
background-color: transparentize($bg_color,0.5);
border-color: transparentize($borders_color,0.5);
border-#{$_border}-color: $selected_bg_color;
@ -1753,7 +1753,7 @@ column-header.button.dnd { // for treeview-like derive widgets
color: mix($backdrop_fg_color, $backdrop_insensitive_color, 50%);
}
}
.active-page .label, .label.active-page {
&:active .label {
// active tab text
color: $fg_color;
&:backdrop { color: $backdrop_fg_color; }

View File

@ -2132,7 +2132,7 @@ column-header .titlebar .button.titlebutton,
border-left-width: 3px; }
.notebook tab:hover, .notebook tab.prelight-page {
border-color: #1c1f1f; }
.notebook tab:active, .notebook tab.active-page, .notebook tab:backdrop:active {
.notebook tab:active, .notebook tab:backdrop:active {
border-color: #215d9c; }
.notebook tab:backdrop {
background-color: transparent;
@ -2143,13 +2143,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(28, 31, 31, 0.3);
border-bottom-color: #1c1f1f;
background-color: rgba(57, 63, 63, 0.2); }
.notebook tab.reorderable-page.top:active, .notebook tab.reorderable-page.top.active-page {
.notebook tab.reorderable-page.top:active {
background-color: rgba(57, 63, 63, 0.5);
border-color: rgba(28, 31, 31, 0.5);
border-bottom-color: #215d9c; }
.notebook tab.reorderable-page.top:active:hover, .notebook tab.reorderable-page.top.active-page:hover {
.notebook tab.reorderable-page.top:active:hover {
background-color: rgba(57, 63, 63, 0.7); }
.notebook tab.reorderable-page.top:active:backdrop, .notebook tab.reorderable-page.top.active-page:backdrop {
.notebook tab.reorderable-page.top:active:backdrop {
border-color: #1e2222;
background-color: #393f3f;
border-bottom-color: #215d9c; }
@ -2162,13 +2162,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(28, 31, 31, 0.3);
border-top-color: #1c1f1f;
background-color: rgba(57, 63, 63, 0.2); }
.notebook tab.reorderable-page.bottom:active, .notebook tab.reorderable-page.bottom.active-page {
.notebook tab.reorderable-page.bottom:active {
background-color: rgba(57, 63, 63, 0.5);
border-color: rgba(28, 31, 31, 0.5);
border-top-color: #215d9c; }
.notebook tab.reorderable-page.bottom:active:hover, .notebook tab.reorderable-page.bottom.active-page:hover {
.notebook tab.reorderable-page.bottom:active:hover {
background-color: rgba(57, 63, 63, 0.7); }
.notebook tab.reorderable-page.bottom:active:backdrop, .notebook tab.reorderable-page.bottom.active-page:backdrop {
.notebook tab.reorderable-page.bottom:active:backdrop {
border-color: #1e2222;
background-color: #393f3f;
border-top-color: #215d9c; }
@ -2181,13 +2181,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(28, 31, 31, 0.3);
border-right-color: #1c1f1f;
background-color: rgba(57, 63, 63, 0.2); }
.notebook tab.reorderable-page.left:active, .notebook tab.reorderable-page.left.active-page {
.notebook tab.reorderable-page.left:active {
background-color: rgba(57, 63, 63, 0.5);
border-color: rgba(28, 31, 31, 0.5);
border-right-color: #215d9c; }
.notebook tab.reorderable-page.left:active:hover, .notebook tab.reorderable-page.left.active-page:hover {
.notebook tab.reorderable-page.left:active:hover {
background-color: rgba(57, 63, 63, 0.7); }
.notebook tab.reorderable-page.left:active:backdrop, .notebook tab.reorderable-page.left.active-page:backdrop {
.notebook tab.reorderable-page.left:active:backdrop {
border-color: #1e2222;
background-color: #393f3f;
border-right-color: #215d9c; }
@ -2200,13 +2200,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(28, 31, 31, 0.3);
border-left-color: #1c1f1f;
background-color: rgba(57, 63, 63, 0.2); }
.notebook tab.reorderable-page.right:active, .notebook tab.reorderable-page.right.active-page {
.notebook tab.reorderable-page.right:active {
background-color: rgba(57, 63, 63, 0.5);
border-color: rgba(28, 31, 31, 0.5);
border-left-color: #215d9c; }
.notebook tab.reorderable-page.right:active:hover, .notebook tab.reorderable-page.right.active-page:hover {
.notebook tab.reorderable-page.right:active:hover {
background-color: rgba(57, 63, 63, 0.7); }
.notebook tab.reorderable-page.right:active:backdrop, .notebook tab.reorderable-page.right.active-page:backdrop {
.notebook tab.reorderable-page.right:active:backdrop {
border-color: #1e2222;
background-color: #393f3f;
border-left-color: #215d9c; }
@ -2223,9 +2223,9 @@ column-header .titlebar .button.titlebutton,
color: #c0c2c0; }
.notebook tab .prelight-page .label:backdrop, .notebook tab .label.prelight-page:backdrop {
color: #787e7e; }
.notebook tab .active-page .label, .notebook tab .label.active-page {
.notebook tab:active .label {
color: #eeeeec; }
.notebook tab .active-page .label:backdrop, .notebook tab .label.active-page:backdrop {
.notebook tab:active .label:backdrop {
color: #939695; }
.notebook tab .button, .notebook tab .header-bar .button.titlebutton, .header-bar .notebook tab .button.titlebutton,
.notebook tab .titlebar .button.titlebutton,

View File

@ -2138,7 +2138,7 @@ column-header .titlebar .button.titlebutton,
border-left-width: 3px; }
.notebook tab:hover, .notebook tab.prelight-page {
border-color: #a1a1a1; }
.notebook tab:active, .notebook tab.active-page, .notebook tab:backdrop:active {
.notebook tab:active, .notebook tab:backdrop:active {
border-color: #4a90d9; }
.notebook tab:backdrop {
background-color: transparent;
@ -2149,13 +2149,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(161, 161, 161, 0.3);
border-bottom-color: #a1a1a1;
background-color: rgba(237, 237, 237, 0.2); }
.notebook tab.reorderable-page.top:active, .notebook tab.reorderable-page.top.active-page {
.notebook tab.reorderable-page.top:active {
background-color: rgba(237, 237, 237, 0.5);
border-color: rgba(161, 161, 161, 0.5);
border-bottom-color: #4a90d9; }
.notebook tab.reorderable-page.top:active:hover, .notebook tab.reorderable-page.top.active-page:hover {
.notebook tab.reorderable-page.top:active:hover {
background-color: rgba(237, 237, 237, 0.7); }
.notebook tab.reorderable-page.top:active:backdrop, .notebook tab.reorderable-page.top.active-page:backdrop {
.notebook tab.reorderable-page.top:active:backdrop {
border-color: #a8a8a8;
background-color: #ededed;
border-bottom-color: #4a90d9; }
@ -2168,13 +2168,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(161, 161, 161, 0.3);
border-top-color: #a1a1a1;
background-color: rgba(237, 237, 237, 0.2); }
.notebook tab.reorderable-page.bottom:active, .notebook tab.reorderable-page.bottom.active-page {
.notebook tab.reorderable-page.bottom:active {
background-color: rgba(237, 237, 237, 0.5);
border-color: rgba(161, 161, 161, 0.5);
border-top-color: #4a90d9; }
.notebook tab.reorderable-page.bottom:active:hover, .notebook tab.reorderable-page.bottom.active-page:hover {
.notebook tab.reorderable-page.bottom:active:hover {
background-color: rgba(237, 237, 237, 0.7); }
.notebook tab.reorderable-page.bottom:active:backdrop, .notebook tab.reorderable-page.bottom.active-page:backdrop {
.notebook tab.reorderable-page.bottom:active:backdrop {
border-color: #a8a8a8;
background-color: #ededed;
border-top-color: #4a90d9; }
@ -2187,13 +2187,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(161, 161, 161, 0.3);
border-right-color: #a1a1a1;
background-color: rgba(237, 237, 237, 0.2); }
.notebook tab.reorderable-page.left:active, .notebook tab.reorderable-page.left.active-page {
.notebook tab.reorderable-page.left:active {
background-color: rgba(237, 237, 237, 0.5);
border-color: rgba(161, 161, 161, 0.5);
border-right-color: #4a90d9; }
.notebook tab.reorderable-page.left:active:hover, .notebook tab.reorderable-page.left.active-page:hover {
.notebook tab.reorderable-page.left:active:hover {
background-color: rgba(237, 237, 237, 0.7); }
.notebook tab.reorderable-page.left:active:backdrop, .notebook tab.reorderable-page.left.active-page:backdrop {
.notebook tab.reorderable-page.left:active:backdrop {
border-color: #a8a8a8;
background-color: #ededed;
border-right-color: #4a90d9; }
@ -2206,13 +2206,13 @@ column-header .titlebar .button.titlebutton,
border-color: rgba(161, 161, 161, 0.3);
border-left-color: #a1a1a1;
background-color: rgba(237, 237, 237, 0.2); }
.notebook tab.reorderable-page.right:active, .notebook tab.reorderable-page.right.active-page {
.notebook tab.reorderable-page.right:active {
background-color: rgba(237, 237, 237, 0.5);
border-color: rgba(161, 161, 161, 0.5);
border-left-color: #4a90d9; }
.notebook tab.reorderable-page.right:active:hover, .notebook tab.reorderable-page.right.active-page:hover {
.notebook tab.reorderable-page.right:active:hover {
background-color: rgba(237, 237, 237, 0.7); }
.notebook tab.reorderable-page.right:active:backdrop, .notebook tab.reorderable-page.right.active-page:backdrop {
.notebook tab.reorderable-page.right:active:backdrop {
border-color: #a8a8a8;
background-color: #ededed;
border-left-color: #4a90d9; }
@ -2229,9 +2229,9 @@ column-header .titlebar .button.titlebutton,
color: #5d6263; }
.notebook tab .prelight-page .label:backdrop, .notebook tab .label.prelight-page:backdrop {
color: #aaabac; }
.notebook tab .active-page .label, .notebook tab .label.active-page {
.notebook tab:active .label {
color: #2e3436; }
.notebook tab .active-page .label:backdrop, .notebook tab .label.active-page:backdrop {
.notebook tab:active .label:backdrop {
color: #8d9091; }
.notebook tab .button, .notebook tab .header-bar .button.titlebutton, .header-bar .notebook tab .button.titlebutton,
.notebook tab .titlebar .button.titlebutton,

View File

@ -1380,7 +1380,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells
&:hover, &.prelight-page {
border-color: $borders_color;
}
&:active, &.active-page, &:backdrop:active {
&:active, &:backdrop:active {
border-color: $selected_bg_color;
}
&:backdrop {
@ -1398,7 +1398,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells
border-#{$_border}-color: $borders_color;
background-color: transparentize($bg_color,0.8);
}
&:active, &.active-page {
&:active {
background-color: transparentize($bg_color,0.5);
border-color: transparentize($borders_color,0.5);
border-#{$_border}-color: $selected_bg_color;
@ -1427,7 +1427,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells
// prelight tab text
color: mix($fg_color, $insensitive_fg_color, 50%);
}
&.active-page GtkLabel, GtkLabel.active-page {
&:active GtkLabel {
// active tab text
color: $fg_color;
&:backdrop { color: $backdrop_fg_color; }

View File

@ -1523,7 +1523,7 @@ GtkTreeView.view.progressbar {
border-left-width: 3px; }
.notebook tab:hover, .notebook tab.prelight-page {
border-color: #7f7f7f; }
.notebook tab:active, .notebook tab.active-page, .notebook tab:backdrop:active {
.notebook tab:active, .notebook tab:backdrop:active {
border-color: #000; }
.notebook tab:backdrop {
background-color: transparent;
@ -1534,13 +1534,13 @@ GtkTreeView.view.progressbar {
border-color: rgba(127, 127, 127, 0.3);
border-bottom-color: #7f7f7f;
background-color: rgba(255, 255, 255, 0.2); }
.notebook tab.reorderable-page.top:active, .notebook tab.reorderable-page.top.active-page {
.notebook tab.reorderable-page.top:active {
background-color: rgba(255, 255, 255, 0.5);
border-color: rgba(127, 127, 127, 0.5);
border-bottom-color: #000; }
.notebook tab.reorderable-page.top:active:hover, .notebook tab.reorderable-page.top.active-page:hover {
.notebook tab.reorderable-page.top:active:hover {
background-color: rgba(255, 255, 255, 0.7); }
.notebook tab.reorderable-page.top:active:backdrop, .notebook tab.reorderable-page.top.active-page:backdrop {
.notebook tab.reorderable-page.top:active:backdrop {
border-color: #8b8b8b;
background-color: #fff;
border-bottom-color: #000; }
@ -1553,13 +1553,13 @@ GtkTreeView.view.progressbar {
border-color: rgba(127, 127, 127, 0.3);
border-top-color: #7f7f7f;
background-color: rgba(255, 255, 255, 0.2); }
.notebook tab.reorderable-page.bottom:active, .notebook tab.reorderable-page.bottom.active-page {
.notebook tab.reorderable-page.bottom:active {
background-color: rgba(255, 255, 255, 0.5);
border-color: rgba(127, 127, 127, 0.5);
border-top-color: #000; }
.notebook tab.reorderable-page.bottom:active:hover, .notebook tab.reorderable-page.bottom.active-page:hover {
.notebook tab.reorderable-page.bottom:active:hover {
background-color: rgba(255, 255, 255, 0.7); }
.notebook tab.reorderable-page.bottom:active:backdrop, .notebook tab.reorderable-page.bottom.active-page:backdrop {
.notebook tab.reorderable-page.bottom:active:backdrop {
border-color: #8b8b8b;
background-color: #fff;
border-top-color: #000; }
@ -1572,13 +1572,13 @@ GtkTreeView.view.progressbar {
border-color: rgba(127, 127, 127, 0.3);
border-right-color: #7f7f7f;
background-color: rgba(255, 255, 255, 0.2); }
.notebook tab.reorderable-page.left:active, .notebook tab.reorderable-page.left.active-page {
.notebook tab.reorderable-page.left:active {
background-color: rgba(255, 255, 255, 0.5);
border-color: rgba(127, 127, 127, 0.5);
border-right-color: #000; }
.notebook tab.reorderable-page.left:active:hover, .notebook tab.reorderable-page.left.active-page:hover {
.notebook tab.reorderable-page.left:active:hover {
background-color: rgba(255, 255, 255, 0.7); }
.notebook tab.reorderable-page.left:active:backdrop, .notebook tab.reorderable-page.left.active-page:backdrop {
.notebook tab.reorderable-page.left:active:backdrop {
border-color: #8b8b8b;
background-color: #fff;
border-right-color: #000; }
@ -1591,13 +1591,13 @@ GtkTreeView.view.progressbar {
border-color: rgba(127, 127, 127, 0.3);
border-left-color: #7f7f7f;
background-color: rgba(255, 255, 255, 0.2); }
.notebook tab.reorderable-page.right:active, .notebook tab.reorderable-page.right.active-page {
.notebook tab.reorderable-page.right:active {
background-color: rgba(255, 255, 255, 0.5);
border-color: rgba(127, 127, 127, 0.5);
border-left-color: #000; }
.notebook tab.reorderable-page.right:active:hover, .notebook tab.reorderable-page.right.active-page:hover {
.notebook tab.reorderable-page.right:active:hover {
background-color: rgba(255, 255, 255, 0.7); }
.notebook tab.reorderable-page.right:active:backdrop, .notebook tab.reorderable-page.right.active-page:backdrop {
.notebook tab.reorderable-page.right:active:backdrop {
border-color: #8b8b8b;
background-color: #fff;
border-left-color: #000; }
@ -1613,9 +1613,9 @@ GtkTreeView.view.progressbar {
color: #7f7f7f; }
.notebook tab.prelight-page GtkLabel, .notebook tab GtkLabel.prelight-page {
color: #3f3f3f; }
.notebook tab.active-page GtkLabel, .notebook tab GtkLabel.active-page {
.notebook tab:active GtkLabel {
color: #000; }
.notebook tab.active-page GtkLabel:backdrop, .notebook tab GtkLabel.active-page:backdrop {
.notebook tab:active GtkLabel:backdrop {
color: #000; }
.notebook tab .button {
border: 2px solid transparent;