1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-27 15:02:50 -05:00

themes: consistent usage of primaryPressed

This commit is contained in:
bbedward
2025-12-23 21:45:06 -05:00
parent d7ac0d50fa
commit 45d34dcb5b
9 changed files with 120 additions and 90 deletions

View File

@@ -18,35 +18,36 @@ Column {
property bool isInitialized: false
function loadValue() {
const settings = findSettings()
const settings = findSettings();
if (settings && settings.pluginService) {
const loadedValue = settings.loadValue(settingKey, defaultValue)
value = loadedValue
isInitialized = true
const loadedValue = settings.loadValue(settingKey, defaultValue);
value = loadedValue;
isInitialized = true;
}
}
Component.onCompleted: {
Qt.callLater(loadValue)
Qt.callLater(loadValue);
}
onValueChanged: {
if (!isInitialized) return
const settings = findSettings()
if (!isInitialized)
return;
const settings = findSettings();
if (settings) {
settings.saveValue(settingKey, value)
settings.saveValue(settingKey, value);
}
}
function findSettings() {
let item = parent
let item = parent;
while (item) {
if (item.saveValue !== undefined && item.loadValue !== undefined) {
return item
return item;
}
item = item.parent
item = item.parent;
}
return null
return null;
}
StyledText {
@@ -82,12 +83,12 @@ Column {
cursorShape: Qt.PointingHandCursor
onClicked: {
if (PopoutService && PopoutService.colorPickerModal) {
PopoutService.colorPickerModal.selectedColor = root.value
PopoutService.colorPickerModal.pickerTitle = root.label
PopoutService.colorPickerModal.onColorSelectedCallback = function(selectedColor) {
root.value = selectedColor
}
PopoutService.colorPickerModal.show()
PopoutService.colorPickerModal.selectedColor = root.value;
PopoutService.colorPickerModal.pickerTitle = root.label;
PopoutService.colorPickerModal.onColorSelectedCallback = function (selectedColor) {
root.value = selectedColor;
};
PopoutService.colorPickerModal.show();
}
}
}