From bc725bd507055470521639b604f1678f1c50d124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ruiz=20de=20Alegr=C3=ADa?= Date: Thu, 4 Mar 2021 09:21:00 +0100 Subject: [PATCH] GTK4: Add setting for compact widgets --- src/themes/Kali/sass/gtk4/_common-tweaks.scss | 47 ++++++++++++++++++- 1 file changed, 46 insertions(+), 1 deletion(-) diff --git a/src/themes/Kali/sass/gtk4/_common-tweaks.scss b/src/themes/Kali/sass/gtk4/_common-tweaks.scss index a70ea132..b2481464 100644 --- a/src/themes/Kali/sass/gtk4/_common-tweaks.scss +++ b/src/themes/Kali/sass/gtk4/_common-tweaks.scss @@ -1,9 +1,22 @@ $_widget_inset_shadow: inset 0 3px 10px -4px $shadow_color, 0 1px rgba(255, 255, 255, .05); +// Optional compact sizes for buttons, headerbar and headerbar widgets +$_sizevariant: 'compact'; //compact otherwise +$_headerbar_height: if($_sizevariant=='default', 46px, 40px); +$_entry_height: if($_sizevariant=='default', 32px, 28px); +$_btn_pad: if($_sizevariant=='default', 4px 9px, 2px 6px); +$_hb_btn_pad: if($_sizevariant=='default', 6px, 5px); +$_img_btn_pad: if($_sizevariant=='default', 5px, 2px); +$_circ_btn_pad: if($_sizevariant=='default', 4px, 2px); +$_switch_margin: if($_sizevariant=='default', 10px, 7px); + /********** * Button * **********/ +%button, button { + @at-root %button_basic, & { padding: $_btn_pad; } + @at-root %button_active, &:active, &:checked { @@ -23,6 +36,17 @@ button { &:backdrop { @include button(undecorated); } } + + &.image-button { + padding-left: $_img_btn_pad; + padding-right: $_img_btn_pad; + } + + &.circular { + min-height: 24px; + min-width: 24px; + padding: $_circ_btn_pad; + } } /********** @@ -30,6 +54,8 @@ button { **********/ %entry, entry { + %entry_basic, & { min-height: $_entry_height; } + &:not(:disabled) { box-shadow: $_widget_inset_shadow; background: if($variant=='dark', $dark_fill, $bg_color); @@ -153,9 +179,11 @@ scale slider { /*************** * Header bars * ***************/ -.titlebar, +%titlebar, headerbar { $_border_color: darken($bg_color, 20%); + + min-height: $_headerbar_height; border-color: $_border_color; $_scale_asset: 'assets/kali-headerbar-logo#{$asset_suffix}'; @@ -185,6 +213,20 @@ headerbar { } } +headerbar { + entry, + spinbutton, + separator:not(.sidebar), + button { + margin-top: $_hb_btn_pad; + margin-bottom: $_hb_btn_pad; + } + switch { + margin-top: $_switch_margin; + margin-bottom: $_switch_margin; + } +} + /************* * Notebooks * *************/ @@ -264,3 +306,6 @@ notebook { } } } + +windowcontrols button { padding: $_hb_btn_pad; } +