From fbce32bf0ff9232eaf8075b2fd6cc34002f1ef46 Mon Sep 17 00:00:00 2001 From: Fabian Vogt Date: Tue, 12 Oct 2021 10:03:30 +0200 Subject: [PATCH] Revert "gtk3, gtk4: update button style" This reverts commit 3b2ce1abd2f45cf844c43cac6e7009a59bff0dd9. --- src/gtk3/widgets/_button.scss | 21 ++++++++++----------- src/gtk3/widgets/_headerbar.scss | 6 ++++-- src/gtk4/widgets/_button.scss | 28 ++++++++++------------------ src/gtk4/widgets/_headerbar.scss | 3 +-- 4 files changed, 25 insertions(+), 33 deletions(-) diff --git a/src/gtk3/widgets/_button.scss b/src/gtk3/widgets/_button.scss index 4bd0ce7..004c4e6 100644 --- a/src/gtk3/widgets/_button.scss +++ b/src/gtk3/widgets/_button.scss @@ -40,22 +40,16 @@ // // pushed button // - color: gtk("@theme_button_foreground_normal"); - border-color: gtkmix(gtk("@theme_button_background_normal"), gtk("@theme_button_foreground_normal"), 0.3); - background-color: gtkalpha(gtk("@theme_button_foreground_normal"), 0.125); - } @else if $t == titlebar-active { - // - // pushed button - // - color: gtk("@theme_button_foreground_normal"); - border-color: gtkmix(gtk("@theme_button_decoration_focus"), gtk("@theme_button_decoration_focus"), 0.3); - background-color: gtkalpha(gtk("@theme_button_decoration_focus"), 0.125); + color: gtk("@theme_button_foreground_active"); + border-color: gtk("@theme_button_decoration_focus"); + background-color: gtk("@theme_button_decoration_focus"); } @else if $t==active-hover { // - // pushed & hovered button + // // color: gtk("@theme_button_foreground_normal"); border-color: gtk("@theme_button_decoration_hover"); + background-color: gtk("@theme_button_decoration_hover"); } @else if $t==insensitive { // // insensitive button @@ -176,6 +170,7 @@ $_dot_color: gtk("@theme_button_decoration_focus"); @include button(normal); &.flat { + @include button(undecorated); // to avoid adiacent buttons borders clashing when transitioning, the transition on the normal state is set // to none, while it's added back in the hover state, so the button decoration will fade in on hover, but // it won't fade out when the pointer leave the button allocation area. To make the transition more evident @@ -228,12 +223,15 @@ $_dot_color: gtk("@theme_button_decoration_focus"); } &.flat:backdrop { -gtk-icon-effect: none; + @include button(undecorated); color: gtk("@theme_button_foreground_backdrop"); } &.flat:disabled { + @include button(undecorated); color: gtk("@theme_button_foreground_insensitive"); } &.flat:backdrop:disabled { + @include button(undecorated); color: gtk("@theme_button_foreground_backdrop_insensitive"); } &:disabled { @@ -357,6 +355,7 @@ button { &.flat:backdrop, &.flat:disabled, &.flat:backdrop:disabled { + @include button(undecorated); color: gtkalpha($button_color, 0.8); } &:disabled { diff --git a/src/gtk3/widgets/_headerbar.scss b/src/gtk3/widgets/_headerbar.scss index 7db8451..1bfe580 100644 --- a/src/gtk3/widgets/_headerbar.scss +++ b/src/gtk3/widgets/_headerbar.scss @@ -53,8 +53,10 @@ headerbar { } &:active, &:checked { - @include button(titlebar-active); - color: gtk("@theme_titlebar_foreground"); + @include button(active); + &:hover { + @include button(active-hover); + } &:backdrop { background-image: none; background-color: gtk("@theme_titlebar_background_backdrop"); diff --git a/src/gtk4/widgets/_button.scss b/src/gtk4/widgets/_button.scss index 08d84d7..c026430 100644 --- a/src/gtk4/widgets/_button.scss +++ b/src/gtk4/widgets/_button.scss @@ -42,29 +42,21 @@ } @else if $t==active { - // - // pushed button - // - color: gtk("@theme_button_foreground_normal"); - border-color: gtkmix(gtk("@theme_button_background_normal"), gtk("@theme_button_foreground_normal"), 0.3); - background-color: gtkalpha(gtk("@theme_button_foreground_normal"), 0.125); - } - - @else if $t == titlebar-active { - // - // pushed button - // - color: gtk("@theme_button_foreground_normal"); - border-color: gtkmix(gtk("@theme_button_decoration_focus"), gtk("@theme_button_decoration_focus"), 0.3); - background-color: gtkalpha(gtk("@theme_button_decoration_focus"), 0.125); + // + // pushed button + // + color: gtk("@theme_button_foreground_active"); + border-color: gtk("@theme_button_decoration_focus"); + background-color: gtk("@theme_button_decoration_focus"); } @else if $t==active-hover { - // - // pushed & hovered button - // + // + // + // color: gtk("@theme_button_foreground_normal"); border-color: gtk("@theme_button_decoration_hover"); + background-color: gtk("@theme_button_decoration_hover"); } @else if $t==insensitive { diff --git a/src/gtk4/widgets/_headerbar.scss b/src/gtk4/widgets/_headerbar.scss index b1a88c5..b09bc01 100644 --- a/src/gtk4/widgets/_headerbar.scss +++ b/src/gtk4/widgets/_headerbar.scss @@ -50,8 +50,7 @@ headerbar { } } &:active, &:checked { - @include button(titlebar-active); - color: gtk("@theme_titlebar_foreground"); + @include button(active); &:hover { @include button(active-hover); } -- 2.33.0