sideleft: make it possible to un-expand

This commit is contained in:
end-4 2025-04-03 16:04:30 +02:00
parent 8bae3e14e9
commit 6750679d88
2 changed files with 7 additions and 13 deletions

View file

@ -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',

View file

@ -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%);
}