cc: allow sliders to shrink to 0.5 height

related #3880
port 2.0

(cherry picked from commit 6bd0e24bd4)
This commit is contained in:
bbedward
2026-10-23 13:55:41 +00:00
committed by dux-ci[bot]
parent 2befd45974
commit 58d741ec07
2 changed files with 10 additions and 6 deletions
@@ -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
}
@@ -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) {