summaryrefslogtreecommitdiff
path: root/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml
diff options
context:
space:
mode:
authorAlexanderCurl <alexc@alexc.hu>2026-04-18 17:46:06 +0100
committerAlexanderCurl <alexc@alexc.hu>2026-04-18 17:46:06 +0100
commit70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69 (patch)
treeab1123d4067c1b086dd6faa7ee4ea643236b565a /raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml
parent5d94c0a7d44a2255b81815a52a7056a94a39842d (diff)
downloadRaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.tar.gz
RaveOS-PKGBUILD-70ca3fef77ee8bdc6e3ac28589a6fa08c024cc69.zip
Replaced file structures for themes in the correct format
Diffstat (limited to 'raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml')
-rw-r--r--raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml163
1 files changed, 163 insertions, 0 deletions
diff --git a/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml
new file mode 100644
index 0000000..7bd02b4
--- /dev/null
+++ b/raveos-hyprland-theme/theme-data/DankMaterialShell/quickshell/Modules/Settings/DesktopWidgetSettings/ClockSettings.qml
@@ -0,0 +1,163 @@
+pragma ComponentBehavior: Bound
+
+import QtQuick
+import qs.Common
+import qs.Widgets
+import qs.Modules.Settings.Widgets
+
+Column {
+ id: root
+
+ property string instanceId: ""
+ property var instanceData: null
+
+ readonly property var cfg: instanceData?.config ?? {}
+
+ function updateConfig(key, value) {
+ if (!instanceId)
+ return;
+ var updates = {};
+ updates[key] = value;
+ SettingsData.updateDesktopWidgetInstanceConfig(instanceId, updates);
+ }
+
+ width: parent?.width ?? 400
+ spacing: 0
+
+ SettingsDropdownRow {
+ text: I18n.tr("Clock Style")
+ options: [I18n.tr("Digital"), I18n.tr("Analog"), I18n.tr("Stacked")]
+ currentValue: {
+ switch (cfg.style) {
+ case "analog":
+ return I18n.tr("Analog");
+ case "stacked":
+ return I18n.tr("Stacked");
+ default:
+ return I18n.tr("Digital");
+ }
+ }
+ onValueChanged: value => {
+ switch (value) {
+ case I18n.tr("Analog"):
+ root.updateConfig("style", "analog");
+ return;
+ case I18n.tr("Stacked"):
+ root.updateConfig("style", "stacked");
+ return;
+ default:
+ root.updateConfig("style", "digital");
+ }
+ }
+ }
+
+ SettingsDivider {
+ visible: cfg.style === "analog"
+ }
+
+ SettingsToggleRow {
+ visible: cfg.style === "analog"
+ text: I18n.tr("Show Hour Numbers")
+ checked: cfg.showAnalogNumbers ?? false
+ onToggled: checked => root.updateConfig("showAnalogNumbers", checked)
+ }
+
+ SettingsDivider {
+ visible: cfg.style === "analog"
+ }
+
+ SettingsToggleRow {
+ visible: cfg.style === "analog"
+ text: I18n.tr("Show Seconds")
+ checked: cfg.showAnalogSeconds ?? true
+ onToggled: checked => root.updateConfig("showAnalogSeconds", checked)
+ }
+
+ SettingsDivider {
+ visible: cfg.style === "digital" || cfg.style === "stacked"
+ }
+
+ SettingsToggleRow {
+ visible: cfg.style === "digital" || cfg.style === "stacked"
+ text: I18n.tr("Show Seconds")
+ checked: cfg.showDigitalSeconds ?? false
+ onToggled: checked => root.updateConfig("showDigitalSeconds", checked)
+ }
+
+ SettingsDivider {}
+
+ SettingsToggleRow {
+ text: I18n.tr("Show Date")
+ checked: cfg.showDate ?? true
+ onToggled: checked => root.updateConfig("showDate", checked)
+ }
+
+ SettingsDivider {}
+
+ SettingsSliderRow {
+ text: I18n.tr("Transparency")
+ minimum: 0
+ maximum: 100
+ value: Math.round((cfg.transparency ?? 0.8) * 100)
+ unit: "%"
+ onSliderValueChanged: newValue => root.updateConfig("transparency", newValue / 100)
+ }
+
+ SettingsDivider {}
+
+ SettingsColorPicker {
+ colorMode: cfg.colorMode ?? "primary"
+ customColor: cfg.customColor ?? "#ffffff"
+ onColorModeSelected: mode => root.updateConfig("colorMode", mode)
+ onCustomColorSelected: selectedColor => root.updateConfig("customColor", selectedColor.toString())
+ }
+
+ SettingsDivider {}
+
+ SettingsDisplayPicker {
+ displayPreferences: cfg.displayPreferences ?? ["all"]
+ onPreferencesChanged: prefs => root.updateConfig("displayPreferences", prefs)
+ }
+
+ SettingsDivider {}
+
+ Item {
+ width: parent.width
+ height: resetRow.height + Theme.spacingM * 2
+
+ Row {
+ id: resetRow
+ x: Theme.spacingM
+ anchors.verticalCenter: parent.verticalCenter
+ spacing: Theme.spacingM
+
+ DankButton {
+ text: I18n.tr("Reset Position")
+ backgroundColor: Theme.surfaceHover
+ textColor: Theme.surfaceText
+ buttonHeight: 36
+ onClicked: {
+ if (!root.instanceId)
+ return;
+ SettingsData.updateDesktopWidgetInstance(root.instanceId, {
+ positions: {}
+ });
+ }
+ }
+
+ DankButton {
+ text: I18n.tr("Reset Size")
+ backgroundColor: Theme.surfaceHover
+ textColor: Theme.surfaceText
+ buttonHeight: 36
+ onClicked: {
+ if (!root.instanceId)
+ return;
+ SettingsData.updateDesktopWidgetInstance(root.instanceId, {
+ positions: {}
+ });
+ }
+ }
+ }
+ }
+}