mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-10-23 11:44:00 -04:00
cc: allow sliders to shrink to 0.5 height
related #3880
port 2.0
(cherry picked from commit 6bd0e24bd4)
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user