diff options
| author | nippy <you@example.com> | 2026-04-18 13:49:56 +0200 |
|---|---|---|
| committer | nippy <you@example.com> | 2026-04-18 13:49:56 +0200 |
| commit | 5d94c0a7d44a2255b81815a52a7056a94a39842d (patch) | |
| tree | 759bdea9645c6a62f9e1e4c001f7d81cccd120d2 /raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Widgets/DankNumberStepper.qml | |
| parent | e79cdf210b267f21a186255ce1a4d50029439d54 (diff) | |
| download | RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.tar.gz RaveOS-PKGBUILD-5d94c0a7d44a2255b81815a52a7056a94a39842d.zip | |
update Raveos themes
Diffstat (limited to 'raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Widgets/DankNumberStepper.qml')
| -rw-r--r-- | raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Widgets/DankNumberStepper.qml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Widgets/DankNumberStepper.qml b/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Widgets/DankNumberStepper.qml new file mode 100644 index 0000000..f4dcf5a --- /dev/null +++ b/raveos-theme/hyprland/theme-data/DankMaterialShell/quickshell/Widgets/DankNumberStepper.qml @@ -0,0 +1,67 @@ +import QtCore +import QtQuick +import qs.Common + +Column { + id: root + property string text: "" + property var incrementTooltipText: "" + property var decrementTooltipText: "" + property var onIncrement: undefined + property var onDecrement: undefined + property string incrementIconName: "keyboard_arrow_up" + property string decrementIconName: "keyboard_arrow_down" + + property bool incrementEnabled: true + property bool decrementEnabled: true + + property color textColor: Theme.surfaceText + property color iconColor: Theme.withAlpha(Theme.surfaceText, 0.5) + property color backgroundColor: Theme.primary + + property int textSize: Theme.fontSizeSmall + property var iconSize: 12 + property int buttonSize: 20 + property int horizontalPadding: Theme.spacingL + + readonly property bool effectiveIncrementEnabled: root.onIncrement ? root.incrementEnabled : false + readonly property bool effectiveDecrementEnabled: root.onDecrement ? root.decrementEnabled : false + + + width: Math.max(buttonSize * 2, root.implicitWidth + horizontalPadding * 2) + spacing: 4 + + DankActionButton { + anchors.horizontalCenter: parent.horizontalCenter + enabled: root.effectiveIncrementEnabled + iconColor: root.effectiveIncrementEnabled ? root.iconColor : Theme.blendAlpha(root.iconColor, 0.5) + iconSize: root.iconSize + buttonSize: root.buttonSize + iconName: root.incrementIconName + onClicked: if (typeof root.onIncrement === 'function') root.onIncrement() + tooltipText: root.incrementTooltipText + } + + Row { + anchors.horizontalCenter: parent.horizontalCenter + Item { width: 5; height: 1 } + StyledText { + isMonospace: true + text: root.text + font.pixelSize: root.textSize + color: root.textColor + } + Item { width: 5; height: 1 } + } + + DankActionButton { + anchors.horizontalCenter: parent.horizontalCenter + enabled: root.effectiveDecrementEnabled + iconColor: root.effectiveDecrementEnabled ? root.iconColor : Theme.blendAlpha(root.iconColor, 0.5) + iconSize: root.iconSize + buttonSize: root.buttonSize + iconName: root.decrementIconName + onClicked: if (typeof root.onDecrement === 'function') root.onDecrement() + tooltipText: root.decrementTooltipText + } +} |