From 6750679d887973da99dd3ecd9736296286ba40c3 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 3 Apr 2025 16:04:30 +0200 Subject: [PATCH] sideleft: make it possible to un-expand --- .config/ags/modules/sideleft/sideleft.js | 6 +++--- .config/ags/scss/_sidebars.scss | 14 ++++---------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/.config/ags/modules/sideleft/sideleft.js b/.config/ags/modules/sideleft/sideleft.js index 01dd91b7..fe63f71d 100644 --- a/.config/ags/modules/sideleft/sideleft.js +++ b/.config/ags/modules/sideleft/sideleft.js @@ -66,10 +66,10 @@ const expandButton = Button({ 'enabled': false, 'toggle': (self) => { self.attribute.enabled = !self.attribute.enabled; + // We don't expand the bar, but the expand button. Funny hax but it works + // (somehow directly expanding the sidebar directly makes it unable to unexpand) + self.toggleClassName('sidebar-expandbtn-enabled', self.attribute.enabled); self.toggleClassName('sidebar-controlbtn-enabled', self.attribute.enabled); - - widgetContent.toggleClassName('sidebar-left-expanded', self.attribute.enabled); - widgetContent.toggleClassName('sidebar-left', !self.attribute.enabled); }, }, vpack: 'start', diff --git a/.config/ags/scss/_sidebars.scss b/.config/ags/scss/_sidebars.scss index ac3bebd4..06df3a91 100644 --- a/.config/ags/scss/_sidebars.scss +++ b/.config/ags/scss/_sidebars.scss @@ -24,16 +24,6 @@ $sidebar_chat_textboxareaColor: mix($onSurfaceVariant, $surfaceVariant, 40%); padding: 1.023rem; } -.sidebar-left-expanded { - @include menu_decel; - @include elevation-border; - @include elevation2; - border-radius: $rounding_large - $elevation_margin + 0.068rem; - min-width: 54.545rem; - background-color: $background; - padding: 1.023rem; -} - .sidebar-group { @include normal-rounding; @include group-padding; @@ -866,6 +856,10 @@ $skeleton-accent: mix($secondary, $onSecondary, 50%); background-color: mix($primary, $hovercolor, 70%); } +.sidebar-expandbtn-enabled { + min-width: 29.113rem; +} + .sidebar-controlbtn-enabled:active { background-color: mix($primary, $hovercolor, 40%); }