changeset 112:bba406abe07c

Add Adwaita/Handy overrides for view switcher This gets us back to a reasonable match for the normal Adwaita/Handy view switcher in older apps
author IBBoard <dev@ibboard.co.uk>
date Sun, 01 May 2022 11:32:36 +0100
parents 3668109a6b96
children 3a790d4649eb
files gtk-3.24/Adwaita-override.css gtk-3.24/gtk.css gtk-3.24/gtk.scss
diffstat 3 files changed, 60 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/gtk-3.24/Adwaita-override.css	Sun May 01 11:32:36 2022 +0100
@@ -0,0 +1,53 @@
+window.csd.unified:not(.solid-csd):not(.fullscreen):not(.tiled):not(.tiled-top):not(.tiled-bottom):not(.tiled-left):not(.tiled-right):not(.maximized), window.csd.unified:not(.solid-csd):not(.fullscreen):not(.tiled):not(.tiled-top):not(.tiled-bottom):not(.tiled-left):not(.tiled-right):not(.maximized) > decoration, window.csd.unified:not(.solid-csd):not(.fullscreen):not(.tiled):not(.tiled-top):not(.tiled-bottom):not(.tiled-left):not(.tiled-right):not(.maximized) > decoration-overlay { border-radius: 8px; }
+
+viewswitcher, viewswitcher button { margin: 0; padding: 0; }
+
+viewswitcher button { border-radius: 0; border-top: 0; border-bottom: 0; box-shadow: none; font-size: 1rem; }
+
+headerbar:not(.selection-mode) viewswitcher button:not(:backdrop) { box-shadow: inset 0 2px #4c4c4c, inset 0 1px #303030; background-color: #3D3D3D; background-origin: border-box; }
+
+viewswitcher button:not(:checked):not(:hover) { background: transparent; }
+
+viewswitcher button:not(:only-child):not(:last-child):not(:hover) { border-right-width: 0px; }
+
+viewswitcher button:not(only-child):first-child:not(:checked):not(:hover), viewswitcher button:not(:checked):not(:hover) + button:not(:checked):not(:hover) { border-left-color: transparent; }
+
+viewswitcher button:not(only-child):last-child:not(:checked):not(:hover) { border-right-color: transparent; }
+/*
+viewswitcher button:not(only-child):first-child:not(:checked):hover, viewswitcher button:not(:checked):hover + button:not(:checked):not(:hover), viewswitcher button:not(:checked):not(:hover) + button:not(:checked):hover { border-left-color: shade(#cdc7c2, 1.15); }
+
+viewswitcher button:not(only-child):last-child:not(:checked):hover { border-right-color: shade(#cdc7c2, 1.15); }
+
+viewswitcher button:not(:checked):hover:backdrop { background-image: image(#f6f5f4); }
+
+headerbar viewswitcher button:not(:checked):hover:not(:backdrop) { background-image: linear-gradient(to top, shade(alpha(#f6f5f4, 0.7), 0.96) 2px, alpha(#f6f5f4, 0.7)); }
+
+headerbar viewswitcher button:not(:checked):not(only-child):first-child:hover, headerbar viewswitcher button:not(:checked):hover + button:not(:checked):not(:hover), headerbar viewswitcher button:not(:checked):not(:hover) + button:not(:checked):hover { border-left-color: #cdc7c2; }
+
+headerbar viewswitcher button:not(:checked):not(only-child):last-child:hover { border-right-color: #cdc7c2; }
+
+headerbar viewswitcher button:not(:checked):hover:backdrop { background-image: image(#f6f5f4); }
+*/
+viewswitcher button > stack > box.narrow { font-size: 0.75rem; padding-top: 7px; padding-bottom: 5px; }
+
+viewswitcher button > stack > box.narrow image, viewswitcher button > stack > box.narrow label { padding-left: 8px; padding-right: 8px; }
+
+viewswitcher button > stack > box.wide { padding: 8px 12px; }
+
+viewswitcher button > stack > box.wide image:dir(ltr) { padding-left: 7px; }
+
+viewswitcher button > stack > box.wide image:dir(rtl) { padding-right: 7px; }
+
+viewswitcher button > stack > box.wide label:dir(ltr) { padding-right: 7px; }
+
+viewswitcher button > stack > box.wide label:dir(rtl) { padding-left: 7px; }
+
+viewswitcher button > stack > box label.active { font-weight: bold; }
+
+viewswitcher button.needs-attention:active > stack > box label, viewswitcher button.needs-attention:checked > stack > box label { animation: none; background-image: none; }
+
+viewswitcher button.needs-attention > stack > box label { animation: needs_attention 150ms ease-in; background-image: -gtk-gradient(radial, center center, 0, center center, 0.5, to(#5E7F3E), to(transparent)), -gtk-gradient(radial, center center, 0, center center, 0.5, to(rgba(255, 255, 255, 0.769231)), to(transparent)); background-size: 6px 6px, 6px 6px; background-repeat: no-repeat; background-position: right 0px, right 1px; }
+
+viewswitcher button.needs-attention > stack > box label:backdrop { background-size: 6px 6px, 0 0; }
+
+viewswitcher button.needs-attention > stack > box label:dir(rtl) { background-position: left 0px, left 1px; }
\ No newline at end of file
--- a/gtk-3.24/gtk.css	Tue Apr 26 20:57:31 2022 +0100
+++ b/gtk-3.24/gtk.css	Sun May 01 11:32:36 2022 +0100
@@ -4,6 +4,7 @@
 @import url("./cawbird.css");
 @import url("./fractal.css");
 @import url("./dconf-editor.css");
+@import url("./Adwaita-override.css");
 * { padding: 0; -GtkToolButton-icon-spacing: 4; -GtkTextView-error-underline-color: #cc0000; -GtkScrolledWindow-scrollbar-spacing: 0; -GtkToolItemGroup-expander-size: 11; -GtkWidget-text-handle-width: 20; -GtkWidget-text-handle-height: 24; -GtkDialog-button-spacing: 4; -GtkDialog-action-area-border: 0; outline-color: alpha(currentColor,0.3); outline-style: dashed; outline-offset: -3px; outline-width: 1px; -gtk-outline-radius: 3px; -gtk-secondary-caret-color: #5E7F3E; }
 
 /*************** Base States * */
--- a/gtk-3.24/gtk.scss	Tue Apr 26 20:57:31 2022 +0100
+++ b/gtk-3.24/gtk.scss	Sun May 01 11:32:36 2022 +0100
@@ -296,7 +296,7 @@
       }
     }
 
-    &:hover, &.titlebutton:hover {
+    &:hover, &.titlebutton:hover, &.radio:hover {
       color: shade($fg_dark_color, 1.3);
       outline-color: $header_button_raised_gradient_color_a;
       border-color: $header_button_border;
@@ -308,7 +308,7 @@
 
     &:active, &:checked,
     &.titlebutton:active, &.titlebutton:active:backdrop, &.titlebutton:checked, &.titlebutton:checked:backdrop,
-    &.toggle:checked {
+    &.toggle:checked, &.radio:checked {
       color: $title_fg;
       outline-color: $header_button_raised_gradient_color_a;
       border-color: $header_button_border;
@@ -811,4 +811,7 @@
 @import url("./fractal.css");
 
 // Customise DConf Editor to try to fix the path bar
-@import url("./dconf-editor.css");
\ No newline at end of file
+@import url("./dconf-editor.css");
+
+// Select Adwaita rules for libhandy/early libadwaita widgets
+@import url("./Adwaita-override.css");
\ No newline at end of file