summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/dms/Widgets/DankNumberStepper.qml
diff options
context:
space:
mode:
authorNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
committerNippy <nippy@rp1.hu>2026-05-08 19:50:49 +0200
commit3462bcc46ecf74f576ea4397f16492c16bd75b10 (patch)
treec5ab7aef4498647e057bda8d49c11e5f9dda74c9 /raveos-hyprland-theme/theme-data/dms/Widgets/DankNumberStepper.qml
parent56616f693b4f263cbf0d47da43b67424efa6022d (diff)
downloadRaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.tar.gz
RaveOS-PKGBUILD-3462bcc46ecf74f576ea4397f16492c16bd75b10.zip
raveos update
Diffstat (limited to 'raveos-hyprland-theme/theme-data/dms/Widgets/DankNumberStepper.qml')
-rw-r--r--raveos-hyprland-theme/theme-data/dms/Widgets/DankNumberStepper.qml67
1 files changed, 67 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/dms/Widgets/DankNumberStepper.qml b/raveos-hyprland-theme/theme-data/dms/Widgets/DankNumberStepper.qml
new file mode 100644
index 0000000..f4dcf5a
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/dms/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
+ }
+}