mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-22 11:05:22 -04:00
refactor(settings): colors & cleanup
This commit is contained in:
@@ -581,6 +581,45 @@ Singleton {
|
|||||||
readonly property int layerOutlineWidth: BlurService.enabled && layerOutlineOpacity > 0 ? 1 : 0
|
readonly property int layerOutlineWidth: BlurService.enabled && layerOutlineOpacity > 0 ? 1 : 0
|
||||||
property color surfaceTextHover: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.08)
|
property color surfaceTextHover: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.08)
|
||||||
property color surfaceTextAlpha: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.3)
|
property color surfaceTextAlpha: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.3)
|
||||||
|
|
||||||
|
function roleColor(mode) {
|
||||||
|
switch (mode) {
|
||||||
|
case "primary":
|
||||||
|
case "pri":
|
||||||
|
return primary;
|
||||||
|
case "primaryContainer":
|
||||||
|
return primaryContainer;
|
||||||
|
case "secondary":
|
||||||
|
case "sec":
|
||||||
|
return secondary;
|
||||||
|
case "secondaryContainer":
|
||||||
|
return secondaryContainer;
|
||||||
|
case "tertiary":
|
||||||
|
case "ter":
|
||||||
|
return tertiary;
|
||||||
|
case "tertiaryContainer":
|
||||||
|
return tertiaryContainer;
|
||||||
|
case "surfaceText":
|
||||||
|
return surfaceText;
|
||||||
|
case "surfaceVariant":
|
||||||
|
return surfaceVariant;
|
||||||
|
case "s":
|
||||||
|
return surface;
|
||||||
|
case "sc":
|
||||||
|
return surfaceContainer;
|
||||||
|
case "sch":
|
||||||
|
return surfaceContainerHigh;
|
||||||
|
case "schh":
|
||||||
|
return surfaceContainerHighest;
|
||||||
|
case "sth":
|
||||||
|
return surfaceTextHover;
|
||||||
|
case "error":
|
||||||
|
case "err":
|
||||||
|
return error;
|
||||||
|
default:
|
||||||
|
return "transparent";
|
||||||
|
}
|
||||||
|
}
|
||||||
property color surfaceTextLight: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.06)
|
property color surfaceTextLight: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.06)
|
||||||
property color surfaceTextMedium: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.7)
|
property color surfaceTextMedium: Qt.rgba(surfaceText.r, surfaceText.g, surfaceText.b, 0.7)
|
||||||
|
|
||||||
|
|||||||
+3
-31
@@ -30,42 +30,14 @@ Column {
|
|||||||
|
|
||||||
function colorForValue(value) {
|
function colorForValue(value) {
|
||||||
switch (value) {
|
switch (value) {
|
||||||
case "primary":
|
|
||||||
case "pri":
|
|
||||||
return Theme.primary;
|
|
||||||
case "primaryContainer":
|
|
||||||
return Theme.primaryContainer;
|
|
||||||
case "secondary":
|
|
||||||
case "sec":
|
|
||||||
return Theme.secondary;
|
|
||||||
case "secondaryContainer":
|
|
||||||
return Theme.secondaryContainer;
|
|
||||||
case "tertiary":
|
|
||||||
case "ter":
|
|
||||||
return Theme.tertiary;
|
|
||||||
case "tertiaryContainer":
|
|
||||||
return Theme.tertiaryContainer;
|
|
||||||
case "surfaceText":
|
|
||||||
return Theme.surfaceText;
|
|
||||||
case "s":
|
|
||||||
return Theme.surface;
|
|
||||||
case "sc":
|
|
||||||
return Theme.surfaceContainer;
|
|
||||||
case "sch":
|
|
||||||
return Theme.surfaceContainerHigh;
|
|
||||||
case "schh":
|
|
||||||
return Theme.surfaceContainerHighest;
|
|
||||||
case "sth":
|
|
||||||
return Theme.surfaceTextHover;
|
|
||||||
case "error":
|
|
||||||
case "err":
|
|
||||||
return Theme.error;
|
|
||||||
case "custom":
|
case "custom":
|
||||||
return root.customColor;
|
return root.customColor;
|
||||||
case "none":
|
case "none":
|
||||||
return "transparent";
|
return "transparent";
|
||||||
default:
|
case "default":
|
||||||
return root.defaultColor;
|
return root.defaultColor;
|
||||||
|
default:
|
||||||
|
return Theme.roleColor(value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -858,13 +858,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsControlledByFrame {
|
|
||||||
visible: dankBarTab.appearanceOnly && SettingsData.frameEnabled
|
|
||||||
parentModal: dankBarTab.parentModal
|
|
||||||
settingLabel: I18n.tr("Bar spacing and size")
|
|
||||||
reason: I18n.tr("Managed by Frame")
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
tab: "appearance"
|
tab: "appearance"
|
||||||
iconName: "space_bar"
|
iconName: "space_bar"
|
||||||
|
|||||||
@@ -1562,7 +1562,7 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceColorRow {
|
ColorDropdownRow {
|
||||||
tab: "theme"
|
tab: "theme"
|
||||||
tags: ["widget", "background", "color", "surface", "material"]
|
tags: ["widget", "background", "color", "surface", "material"]
|
||||||
settingKey: "widgetBackgroundColor"
|
settingKey: "widgetBackgroundColor"
|
||||||
@@ -1607,6 +1607,12 @@ Item {
|
|||||||
text: I18n.tr("Control Center Tile Color")
|
text: I18n.tr("Control Center Tile Color")
|
||||||
description: I18n.tr("Active tile background and icon color", "control center tile color setting description")
|
description: I18n.tr("Active tile background and icon color", "control center tile color setting description")
|
||||||
options: [I18n.tr("Primary", "tile color option"), I18n.tr("Primary Container", "tile color option"), I18n.tr("Secondary", "tile color option"), I18n.tr("Surface Variant", "tile color option")]
|
options: [I18n.tr("Primary", "tile color option"), I18n.tr("Primary Container", "tile color option"), I18n.tr("Secondary", "tile color option"), I18n.tr("Surface Variant", "tile color option")]
|
||||||
|
optionColorMap: ({
|
||||||
|
[I18n.tr("Primary", "tile color option")]: Theme.roleColor("primary"),
|
||||||
|
[I18n.tr("Primary Container", "tile color option")]: Theme.roleColor("primaryContainer"),
|
||||||
|
[I18n.tr("Secondary", "tile color option")]: Theme.roleColor("secondary"),
|
||||||
|
[I18n.tr("Surface Variant", "tile color option")]: Theme.roleColor("surfaceVariant")
|
||||||
|
})
|
||||||
currentValue: {
|
currentValue: {
|
||||||
switch (SettingsData.controlCenterTileColorMode) {
|
switch (SettingsData.controlCenterTileColorMode) {
|
||||||
case "primaryContainer":
|
case "primaryContainer":
|
||||||
@@ -1639,6 +1645,12 @@ Item {
|
|||||||
text: I18n.tr("Button Color")
|
text: I18n.tr("Button Color")
|
||||||
description: I18n.tr("Color for primary action buttons")
|
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")]
|
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")]
|
||||||
|
optionColorMap: ({
|
||||||
|
[I18n.tr("Primary", "button color option")]: Theme.roleColor("primary"),
|
||||||
|
[I18n.tr("Primary Container", "button color option")]: Theme.roleColor("primaryContainer"),
|
||||||
|
[I18n.tr("Secondary", "button color option")]: Theme.roleColor("secondary"),
|
||||||
|
[I18n.tr("Surface Variant", "button color option")]: Theme.roleColor("surfaceVariant")
|
||||||
|
})
|
||||||
currentValue: {
|
currentValue: {
|
||||||
switch (SettingsData.buttonColorMode) {
|
switch (SettingsData.buttonColorMode) {
|
||||||
case "primaryContainer":
|
case "primaryContainer":
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ SettingsCard {
|
|||||||
readonly property bool workspaceStateColorsVisible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
|
readonly property bool workspaceStateColorsVisible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
|
||||||
readonly property bool urgentWorkspaceColorsVisible: workspaceStateColorsVisible || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
readonly property bool urgentWorkspaceColorsVisible: workspaceStateColorsVisible || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
||||||
|
|
||||||
WorkspaceColorRow {
|
ColorDropdownRow {
|
||||||
text: I18n.tr("Focused Color")
|
text: I18n.tr("Focused Color")
|
||||||
settingKey: "workspaceColorMode"
|
settingKey: "workspaceColorMode"
|
||||||
tags: ["workspace", "focused", "color", "custom"]
|
tags: ["workspace", "focused", "color", "custom"]
|
||||||
@@ -202,7 +202,7 @@ SettingsCard {
|
|||||||
opacity: 0.15
|
opacity: 0.15
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceColorRow {
|
ColorDropdownRow {
|
||||||
text: I18n.tr("Occupied Color")
|
text: I18n.tr("Occupied Color")
|
||||||
settingKey: "workspaceOccupiedColorMode"
|
settingKey: "workspaceOccupiedColorMode"
|
||||||
tags: ["workspace", "occupied", "color", "custom"]
|
tags: ["workspace", "occupied", "color", "custom"]
|
||||||
@@ -222,7 +222,7 @@ SettingsCard {
|
|||||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
|
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceColorRow {
|
ColorDropdownRow {
|
||||||
text: I18n.tr("Unfocused Color")
|
text: I18n.tr("Unfocused Color")
|
||||||
settingKey: "workspaceUnfocusedColorMode"
|
settingKey: "workspaceUnfocusedColorMode"
|
||||||
tags: ["workspace", "unfocused", "color", "custom"]
|
tags: ["workspace", "unfocused", "color", "custom"]
|
||||||
@@ -242,7 +242,7 @@ SettingsCard {
|
|||||||
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
visible: CompositorService.isNiri || CompositorService.isHyprland || CompositorService.isMango || CompositorService.isSway || CompositorService.isScroll || CompositorService.isMiracle
|
||||||
}
|
}
|
||||||
|
|
||||||
WorkspaceColorRow {
|
ColorDropdownRow {
|
||||||
text: I18n.tr("Urgent Color")
|
text: I18n.tr("Urgent Color")
|
||||||
settingKey: "workspaceUrgentColorMode"
|
settingKey: "workspaceUrgentColorMode"
|
||||||
tags: ["workspace", "urgent", "color", "custom"]
|
tags: ["workspace", "urgent", "color", "custom"]
|
||||||
@@ -277,7 +277,7 @@ SettingsCard {
|
|||||||
visible: SettingsData.workspaceFocusedBorderEnabled
|
visible: SettingsData.workspaceFocusedBorderEnabled
|
||||||
leftPadding: Theme.spacingM
|
leftPadding: Theme.spacingM
|
||||||
|
|
||||||
WorkspaceColorRow {
|
ColorDropdownRow {
|
||||||
width: parent.width - parent.leftPadding
|
width: parent.width - parent.leftPadding
|
||||||
text: I18n.tr("Border Color")
|
text: I18n.tr("Border Color")
|
||||||
settingKey: "workspaceFocusedBorderColor"
|
settingKey: "workspaceFocusedBorderColor"
|
||||||
|
|||||||
Reference in New Issue
Block a user