1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-24 21:42:51 -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

@@ -93,7 +93,11 @@ Item {
}
const isHovered = mouseArea.containsMouse || (root.isHovered || false);
const baseColor = isHovered ? Theme.widgetBaseHoverColor : Theme.widgetBaseBackgroundColor;
if (isHovered) {
return Theme.primaryPressed;
}
const baseColor = Theme.widgetBaseBackgroundColor;
const transparency = (root.barConfig && root.barConfig.widgetTransparency !== undefined) ? root.barConfig.widgetTransparency : 1.0;
if (Theme.widgetBackgroundHasAlpha) {
return Qt.rgba(baseColor.r, baseColor.g, baseColor.b, baseColor.a * transparency);

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();
}
}
}