From ed574408f24dea9e015140dd2390063d7a95f56f Mon Sep 17 00:00:00 2001 From: Benjamin Otte Date: Mon, 7 Sep 2015 12:30:44 +0200 Subject: [PATCH] notebook: Remove "prelight-page" class Instead, just use the "tab:hover" selector --- gtk/gtknotebook.c | 10 ---------- gtk/theme/Adwaita/_common.scss | 8 ++++---- gtk/theme/Adwaita/gtk-contained-dark.css | 16 ++++++++-------- gtk/theme/Adwaita/gtk-contained.css | 16 ++++++++-------- gtk/theme/HighContrast/_common.scss | 8 ++++---- gtk/theme/HighContrast/gtk.css | 14 +++++++------- 6 files changed, 31 insertions(+), 41 deletions(-) diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c index 8233251cbe..cc3b29f322 100644 --- a/gtk/gtknotebook.c +++ b/gtk/gtknotebook.c @@ -3198,18 +3198,12 @@ update_prelight_tab (GtkNotebook *notebook, { gtk_css_node_set_state (priv->prelight_tab->cssnode, gtk_css_node_get_state (priv->prelight_tab->cssnode) & ~GTK_STATE_FLAG_PRELIGHT); - if (priv->prelight_tab->tab_label) - gtk_style_context_remove_class (gtk_widget_get_style_context (priv->prelight_tab->tab_label), - "prelight-page"); } if (page) { gtk_css_node_set_state (page->cssnode, gtk_css_node_get_state (page->cssnode) | GTK_STATE_FLAG_PRELIGHT); - if (page->tab_label) - gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label), - "prelight-page"); } priv->prelight_tab = page; @@ -7804,10 +7798,6 @@ gtk_notebook_set_tab_label (GtkNotebook *notebook, G_CALLBACK (gtk_notebook_mnemonic_activate_switch_page), notebook); - if (priv->prelight_tab == page) - gtk_style_context_add_class (gtk_widget_get_style_context (page->tab_label), - "prelight-page"); - if (priv->show_tabs && gtk_widget_get_visible (child)) { gtk_widget_show (page->tab_label); diff --git a/gtk/theme/Adwaita/_common.scss b/gtk/theme/Adwaita/_common.scss index 0a33967989..f2cf9a26d3 100644 --- a/gtk/theme/Adwaita/_common.scss +++ b/gtk/theme/Adwaita/_common.scss @@ -1700,7 +1700,7 @@ column-header.button.dnd { // for treeview-like derive widgets } //here's the interesting stuff - &:hover, &.prelight-page { + &:hover { border-color: $borders_color; } &:active, &:backdrop:active { @@ -1716,7 +1716,7 @@ column-header.button.dnd { // for treeview-like derive widgets (right, left) { &.reorderable-page.#{$_tab} { border-color: transparent; - &:hover, &.prelight-page { + &:hover { border-color: transparentize($borders_color,0.7); border-#{$_border}-color: $borders_color; background-color: transparentize($bg_color,0.8); @@ -1742,11 +1742,11 @@ column-header.button.dnd { // for treeview-like derive widgets padding: 0 2px; // needed for a nicer focus ring font-weight: bold; color: $insensitive_fg_color; - &:backdrop, &.prelight-page:backdrop { + &:backdrop { color: mix($backdrop_fg_color, $backdrop_insensitive_color, 50%); } } - .prelight-page .label, .label.prelight-page { + &:hover .label { // prelight tab text color: mix($fg_color, $insensitive_fg_color, 50%); &:backdrop { // FIXME, it's the same as .label:backdrop up here diff --git a/gtk/theme/Adwaita/gtk-contained-dark.css b/gtk/theme/Adwaita/gtk-contained-dark.css index e510eb88f6..4ba76e2a2e 100644 --- a/gtk/theme/Adwaita/gtk-contained-dark.css +++ b/gtk/theme/Adwaita/gtk-contained-dark.css @@ -2130,7 +2130,7 @@ column-header .titlebar .button.titlebutton, border-right-width: 3px; } .notebook tab.right { border-left-width: 3px; } - .notebook tab:hover, .notebook tab.prelight-page { + .notebook tab:hover { border-color: #1c1f1f; } .notebook tab:active, .notebook tab:backdrop:active { border-color: #215d9c; } @@ -2139,7 +2139,7 @@ column-header .titlebar .button.titlebutton, border-color: transparent; } .notebook tab.reorderable-page.top { border-color: transparent; } - .notebook tab.reorderable-page.top:hover, .notebook tab.reorderable-page.top.prelight-page { + .notebook tab.reorderable-page.top:hover { border-color: rgba(28, 31, 31, 0.3); border-bottom-color: #1c1f1f; background-color: rgba(57, 63, 63, 0.2); } @@ -2158,7 +2158,7 @@ column-header .titlebar .button.titlebutton, background-color: transparent; } .notebook tab.reorderable-page.bottom { border-color: transparent; } - .notebook tab.reorderable-page.bottom:hover, .notebook tab.reorderable-page.bottom.prelight-page { + .notebook tab.reorderable-page.bottom:hover { border-color: rgba(28, 31, 31, 0.3); border-top-color: #1c1f1f; background-color: rgba(57, 63, 63, 0.2); } @@ -2177,7 +2177,7 @@ column-header .titlebar .button.titlebutton, background-color: transparent; } .notebook tab.reorderable-page.left { border-color: transparent; } - .notebook tab.reorderable-page.left:hover, .notebook tab.reorderable-page.left.prelight-page { + .notebook tab.reorderable-page.left:hover { border-color: rgba(28, 31, 31, 0.3); border-right-color: #1c1f1f; background-color: rgba(57, 63, 63, 0.2); } @@ -2196,7 +2196,7 @@ column-header .titlebar .button.titlebutton, background-color: transparent; } .notebook tab.reorderable-page.right { border-color: transparent; } - .notebook tab.reorderable-page.right:hover, .notebook tab.reorderable-page.right.prelight-page { + .notebook tab.reorderable-page.right:hover { border-color: rgba(28, 31, 31, 0.3); border-left-color: #1c1f1f; background-color: rgba(57, 63, 63, 0.2); } @@ -2217,11 +2217,11 @@ column-header .titlebar .button.titlebutton, padding: 0 2px; font-weight: bold; color: #939695; } - .notebook tab .label:backdrop, .notebook tab .label.prelight-page:backdrop { + .notebook tab .label:backdrop { color: #787e7e; } - .notebook tab .prelight-page .label, .notebook tab .label.prelight-page { + .notebook tab:hover .label { color: #c0c2c0; } - .notebook tab .prelight-page .label:backdrop, .notebook tab .label.prelight-page:backdrop { + .notebook tab:hover .label:backdrop { color: #787e7e; } .notebook tab:active .label { color: #eeeeec; } diff --git a/gtk/theme/Adwaita/gtk-contained.css b/gtk/theme/Adwaita/gtk-contained.css index 6d47fee18b..3c9aeb2d11 100644 --- a/gtk/theme/Adwaita/gtk-contained.css +++ b/gtk/theme/Adwaita/gtk-contained.css @@ -2136,7 +2136,7 @@ column-header .titlebar .button.titlebutton, border-right-width: 3px; } .notebook tab.right { border-left-width: 3px; } - .notebook tab:hover, .notebook tab.prelight-page { + .notebook tab:hover { border-color: #a1a1a1; } .notebook tab:active, .notebook tab:backdrop:active { border-color: #4a90d9; } @@ -2145,7 +2145,7 @@ column-header .titlebar .button.titlebutton, border-color: transparent; } .notebook tab.reorderable-page.top { border-color: transparent; } - .notebook tab.reorderable-page.top:hover, .notebook tab.reorderable-page.top.prelight-page { + .notebook tab.reorderable-page.top:hover { border-color: rgba(161, 161, 161, 0.3); border-bottom-color: #a1a1a1; background-color: rgba(237, 237, 237, 0.2); } @@ -2164,7 +2164,7 @@ column-header .titlebar .button.titlebutton, background-color: transparent; } .notebook tab.reorderable-page.bottom { border-color: transparent; } - .notebook tab.reorderable-page.bottom:hover, .notebook tab.reorderable-page.bottom.prelight-page { + .notebook tab.reorderable-page.bottom:hover { border-color: rgba(161, 161, 161, 0.3); border-top-color: #a1a1a1; background-color: rgba(237, 237, 237, 0.2); } @@ -2183,7 +2183,7 @@ column-header .titlebar .button.titlebutton, background-color: transparent; } .notebook tab.reorderable-page.left { border-color: transparent; } - .notebook tab.reorderable-page.left:hover, .notebook tab.reorderable-page.left.prelight-page { + .notebook tab.reorderable-page.left:hover { border-color: rgba(161, 161, 161, 0.3); border-right-color: #a1a1a1; background-color: rgba(237, 237, 237, 0.2); } @@ -2202,7 +2202,7 @@ column-header .titlebar .button.titlebutton, background-color: transparent; } .notebook tab.reorderable-page.right { border-color: transparent; } - .notebook tab.reorderable-page.right:hover, .notebook tab.reorderable-page.right.prelight-page { + .notebook tab.reorderable-page.right:hover { border-color: rgba(161, 161, 161, 0.3); border-left-color: #a1a1a1; background-color: rgba(237, 237, 237, 0.2); } @@ -2223,11 +2223,11 @@ column-header .titlebar .button.titlebutton, padding: 0 2px; font-weight: bold; color: #8d9091; } - .notebook tab .label:backdrop, .notebook tab .label.prelight-page:backdrop { + .notebook tab .label:backdrop { color: #aaabac; } - .notebook tab .prelight-page .label, .notebook tab .label.prelight-page { + .notebook tab:hover .label { color: #5d6263; } - .notebook tab .prelight-page .label:backdrop, .notebook tab .label.prelight-page:backdrop { + .notebook tab:hover .label:backdrop { color: #aaabac; } .notebook tab:active .label { color: #2e3436; } diff --git a/gtk/theme/HighContrast/_common.scss b/gtk/theme/HighContrast/_common.scss index b755856a73..77f902e32c 100644 --- a/gtk/theme/HighContrast/_common.scss +++ b/gtk/theme/HighContrast/_common.scss @@ -1377,7 +1377,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells } //here's the interesting stuff - &:hover, &.prelight-page { + &:hover { border-color: $borders_color; } &:active, &:backdrop:active { @@ -1393,7 +1393,7 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells (right, left) { &.reorderable-page.#{$_tab} { border-color: transparent; - &:hover, &.prelight-page { + &:hover { border-color: transparentize($borders_color,0.7); border-#{$_border}-color: $borders_color; background-color: transparentize($bg_color,0.8); @@ -1419,11 +1419,11 @@ GtkTreeView.view.progressbar { //Progressbar in treeview cells padding: 0 2px; // needed for a nicer focus ring font-weight: bold; color: $insensitive_fg_color; /* color: inherit doesn't work here */ - &:backdrop, &.prelight-page:backdrop { + &:backdrop { color: $insensitive_fg_color; } } - &.prelight-page GtkLabel, GtkLabel.prelight-page { + &:hover GtkLabel { // prelight tab text color: mix($fg_color, $insensitive_fg_color, 50%); } diff --git a/gtk/theme/HighContrast/gtk.css b/gtk/theme/HighContrast/gtk.css index d9720a1ee9..21f1a7f680 100644 --- a/gtk/theme/HighContrast/gtk.css +++ b/gtk/theme/HighContrast/gtk.css @@ -1521,7 +1521,7 @@ GtkTreeView.view.progressbar { border-right-width: 3px; } .notebook tab.right { border-left-width: 3px; } - .notebook tab:hover, .notebook tab.prelight-page { + .notebook tab:hover { border-color: #7f7f7f; } .notebook tab:active, .notebook tab:backdrop:active { border-color: #000; } @@ -1530,7 +1530,7 @@ GtkTreeView.view.progressbar { border-color: transparent; } .notebook tab.reorderable-page.top { border-color: transparent; } - .notebook tab.reorderable-page.top:hover, .notebook tab.reorderable-page.top.prelight-page { + .notebook tab.reorderable-page.top:hover { border-color: rgba(127, 127, 127, 0.3); border-bottom-color: #7f7f7f; background-color: rgba(255, 255, 255, 0.2); } @@ -1549,7 +1549,7 @@ GtkTreeView.view.progressbar { background-color: transparent; } .notebook tab.reorderable-page.bottom { border-color: transparent; } - .notebook tab.reorderable-page.bottom:hover, .notebook tab.reorderable-page.bottom.prelight-page { + .notebook tab.reorderable-page.bottom:hover { border-color: rgba(127, 127, 127, 0.3); border-top-color: #7f7f7f; background-color: rgba(255, 255, 255, 0.2); } @@ -1568,7 +1568,7 @@ GtkTreeView.view.progressbar { background-color: transparent; } .notebook tab.reorderable-page.left { border-color: transparent; } - .notebook tab.reorderable-page.left:hover, .notebook tab.reorderable-page.left.prelight-page { + .notebook tab.reorderable-page.left:hover { border-color: rgba(127, 127, 127, 0.3); border-right-color: #7f7f7f; background-color: rgba(255, 255, 255, 0.2); } @@ -1587,7 +1587,7 @@ GtkTreeView.view.progressbar { background-color: transparent; } .notebook tab.reorderable-page.right { border-color: transparent; } - .notebook tab.reorderable-page.right:hover, .notebook tab.reorderable-page.right.prelight-page { + .notebook tab.reorderable-page.right:hover { border-color: rgba(127, 127, 127, 0.3); border-left-color: #7f7f7f; background-color: rgba(255, 255, 255, 0.2); } @@ -1609,9 +1609,9 @@ GtkTreeView.view.progressbar { font-weight: bold; color: #7f7f7f; /* color: inherit doesn't work here */ } - .notebook tab GtkLabel:backdrop, .notebook tab GtkLabel.prelight-page:backdrop { + .notebook tab GtkLabel:backdrop { color: #7f7f7f; } - .notebook tab.prelight-page GtkLabel, .notebook tab GtkLabel.prelight-page { + .notebook tab:hover GtkLabel { color: #3f3f3f; } .notebook tab:active GtkLabel { color: #000; }