1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-04-04 21:02:06 -04:00

widgets: add a button color setting

This commit is contained in:
bbedward
2026-02-03 11:03:33 -05:00
parent 22ab5b9660
commit 3c4749ead0
7 changed files with 105 additions and 19 deletions

View File

@@ -1516,6 +1516,38 @@ Item {
}
}
SettingsDropdownRow {
tab: "theme"
tags: ["button", "color", "primary", "accent"]
settingKey: "buttonColorMode"
text: I18n.tr("Button Color")
description: I18n.tr("Color for primary action buttons")
options: [I18n.tr("Primary", "button color option"), I18n.tr("Primary Container", "button color option"), I18n.tr("Secondary", "button color option"), I18n.tr("Surface Variant", "button color option")]
currentValue: {
switch (SettingsData.buttonColorMode) {
case "primaryContainer":
return I18n.tr("Primary Container", "button color option");
case "secondary":
return I18n.tr("Secondary", "button color option");
case "surfaceVariant":
return I18n.tr("Surface Variant", "button color option");
default:
return I18n.tr("Primary", "button color option");
}
}
onValueChanged: value => {
if (value === I18n.tr("Primary Container", "button color option")) {
SettingsData.set("buttonColorMode", "primaryContainer");
} else if (value === I18n.tr("Secondary", "button color option")) {
SettingsData.set("buttonColorMode", "secondary");
} else if (value === I18n.tr("Surface Variant", "button color option")) {
SettingsData.set("buttonColorMode", "surfaceVariant");
} else {
SettingsData.set("buttonColorMode", "primary");
}
}
}
SettingsSliderRow {
tab: "theme"
tags: ["popup", "transparency", "opacity", "modal"]