From 58d741ec0776f8b7edf5303a5dba0de3e2b2ecfb Mon Sep 17 00:00:00 2001 From: bbedward Date: Fri, 23 Oct 2026 09:55:05 -0400 Subject: [PATCH] cc: allow sliders to shrink to 0.5 height related #3880 port 2.0 (cherry picked from commit 6bd0e24bd4903f62ef55671df94193b8ab16d17b) --- .../Modules/ControlCenter/Widgets/CcSliderRow.qml | 6 ++++-- quickshell/Modules/ControlCenter/utils/widgets.js | 10 ++++++---- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/quickshell/Modules/ControlCenter/Widgets/CcSliderRow.qml b/quickshell/Modules/ControlCenter/Widgets/CcSliderRow.qml index a81f6aacb..93240991d 100644 --- a/quickshell/Modules/ControlCenter/Widgets/CcSliderRow.qml +++ b/quickshell/Modules/ControlCenter/Widgets/CcSliderRow.qml @@ -17,6 +17,8 @@ Item { property real columns: 4 property real rows: 1 property bool compact: columns <= 2 && rows === 1 + property bool small: false + readonly property real bodyInset: small ? Math.max(0, (height - CcMetrics.smallRowHeight) / 2) : 0 property string iconName: "" property string iconLabel: "" property string iconTooltip: "" @@ -135,13 +137,13 @@ Item { onSliderValueChanged: newValue => root.sliderValueChanged(newValue) Binding on trackHeight { - when: !root.tall + when: !root.tall && !root.small value: CcMetrics.stripTrackHeight restoreMode: Binding.RestoreBinding } Binding on handleHeight { - when: !root.tall + when: !root.tall && !root.small value: CcMetrics.stripHandleHeight restoreMode: Binding.RestoreBinding } diff --git a/quickshell/Modules/ControlCenter/utils/widgets.js b/quickshell/Modules/ControlCenter/utils/widgets.js index d496a117b..4afc86f06 100644 --- a/quickshell/Modules/ControlCenter/utils/widgets.js +++ b/quickshell/Modules/ControlCenter/utils/widgets.js @@ -17,7 +17,7 @@ function isSliderWidget(id) { } function canShrink(id) { - return id !== "user" && !isSliderWidget(id); + return id !== "user"; } function isSmall(widget, rows) { @@ -25,7 +25,7 @@ function isSmall(widget, rows) { } function canGroup(widget) { - return canShrink(widget?.id) && widget?.id !== GROUP_ID; + return canShrink(widget?.id) && !isSliderWidget(widget?.id) && widget?.id !== GROUP_ID; } // Members of a group that no longer exists fall back to the grid. @@ -38,10 +38,12 @@ function inGroup(widget, ids) { } function groupMembers(widgets, groupId) { - return widgets.reduce((members, widget, index) => widget?.group === groupId && isShown(widget) ? members.concat([{ + return widgets.reduce((members, widget, index) => widget?.group === groupId && isShown(widget) ? members.concat([ + { "index": index, "widget": widget - }]) : members, []); + } + ]) : members, []); } function isRemovable(widget) {