mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-06 21:48:30 -04:00
feat(settings): add explicit border toggle and updated layouts
- Defaults On with blur enabled to clean up the border edges - Darken Modal moves to Launcher settings Closes #2446 port 1.5
This commit is contained in:
@@ -240,6 +240,8 @@ Singleton {
|
|||||||
onBlurForegroundLayersChanged: saveSettings()
|
onBlurForegroundLayersChanged: saveSettings()
|
||||||
property real blurLayerOutlineOpacity: 0.12
|
property real blurLayerOutlineOpacity: 0.12
|
||||||
onBlurLayerOutlineOpacityChanged: saveSettings()
|
onBlurLayerOutlineOpacityChanged: saveSettings()
|
||||||
|
property bool blurBorderEnabled: true
|
||||||
|
onBlurBorderEnabledChanged: saveSettings()
|
||||||
property string blurBorderColor: "outline"
|
property string blurBorderColor: "outline"
|
||||||
onBlurBorderColorChanged: saveSettings()
|
onBlurBorderColorChanged: saveSettings()
|
||||||
property string blurBorderCustomColor: "#ffffff"
|
property string blurBorderCustomColor: "#ffffff"
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ var SPEC = {
|
|||||||
blurEnabled: { def: false },
|
blurEnabled: { def: false },
|
||||||
blurForegroundLayers: { def: true },
|
blurForegroundLayers: { def: true },
|
||||||
blurLayerOutlineOpacity: { def: 0.12, coerce: percentToUnit },
|
blurLayerOutlineOpacity: { def: 0.12, coerce: percentToUnit },
|
||||||
|
blurBorderEnabled: { def: true },
|
||||||
blurBorderColor: { def: "outline" },
|
blurBorderColor: { def: "outline" },
|
||||||
blurBorderCustomColor: { def: "#ffffff" },
|
blurBorderCustomColor: { def: "#ffffff" },
|
||||||
blurBorderOpacity: { def: 0.35, coerce: percentToUnit },
|
blurBorderOpacity: { def: 0.35, coerce: percentToUnit },
|
||||||
|
|||||||
@@ -746,6 +746,31 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsCard {
|
||||||
|
width: parent.width
|
||||||
|
iconName: "layers"
|
||||||
|
title: I18n.tr("Modal Background")
|
||||||
|
settingKey: "modalBackground"
|
||||||
|
tags: ["modal", "darken", "background", "overlay", "launcher"]
|
||||||
|
|
||||||
|
SettingsControlledByFrame {
|
||||||
|
visible: SettingsData.frameEnabled
|
||||||
|
parentModal: root.parentModal
|
||||||
|
settingLabel: I18n.tr("Darken Modal Background")
|
||||||
|
reason: I18n.tr("Disabled by Frame Mode")
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
settingKey: "modalDarkenBackground"
|
||||||
|
tags: ["modal", "darken", "background", "overlay", "launcher"]
|
||||||
|
text: I18n.tr("Darken Modal Background")
|
||||||
|
description: I18n.tr("Show darkened overlay behind modal dialogs")
|
||||||
|
visible: !SettingsData.frameEnabled
|
||||||
|
checked: SettingsData.modalDarkenBackground
|
||||||
|
onToggled: checked => SettingsData.set("modalDarkenBackground", checked)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
width: parent.width
|
width: parent.width
|
||||||
iconName: "open_in_new"
|
iconName: "open_in_new"
|
||||||
|
|||||||
@@ -1733,16 +1733,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SettingsToggleRow {
|
|
||||||
tab: "theme"
|
|
||||||
tags: ["foreground", "layers", "contrast", "surface", "blur", "glass", "frosted"]
|
|
||||||
settingKey: "blurForegroundLayers"
|
|
||||||
text: I18n.tr("Foreground Layers")
|
|
||||||
description: I18n.tr("Show foreground surfaces on panels for stronger contrast")
|
|
||||||
checked: SettingsData.blurForegroundLayers ?? true
|
|
||||||
onToggled: checked => SettingsData.set("blurForegroundLayers", checked)
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
tab: "theme"
|
tab: "theme"
|
||||||
tags: ["surface", "popup", "transparency", "opacity", "modal"]
|
tags: ["surface", "popup", "transparency", "opacity", "modal"]
|
||||||
@@ -1758,12 +1748,47 @@ Item {
|
|||||||
onSliderValueChanged: newValue => SettingsData.set("popupTransparency", newValue / 100)
|
onSliderValueChanged: newValue => SettingsData.set("popupTransparency", newValue / 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
tab: "theme"
|
||||||
|
tags: ["foreground", "layers", "contrast", "surface", "blur", "glass", "frosted"]
|
||||||
|
settingKey: "blurForegroundLayers"
|
||||||
|
text: I18n.tr("Foreground Layers")
|
||||||
|
description: I18n.tr("Show foreground surfaces on panels for stronger contrast")
|
||||||
|
checked: SettingsData.blurForegroundLayers ?? true
|
||||||
|
onToggled: checked => SettingsData.set("blurForegroundLayers", checked)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsSliderRow {
|
||||||
|
tab: "theme"
|
||||||
|
tags: ["foreground", "layers", "outline", "border", "cards", "widgets", "notifications", "control center"]
|
||||||
|
settingKey: "blurLayerOutlineOpacity"
|
||||||
|
text: I18n.tr("Layer Outline Opacity")
|
||||||
|
description: I18n.tr("Controls outlines around foreground cards, pills, and notification cards")
|
||||||
|
value: Math.round((SettingsData.blurLayerOutlineOpacity ?? 0.12) * 100)
|
||||||
|
minimum: 0
|
||||||
|
maximum: 40
|
||||||
|
unit: "%"
|
||||||
|
defaultValue: 12
|
||||||
|
onSliderValueChanged: newValue => SettingsData.set("blurLayerOutlineOpacity", newValue / 100)
|
||||||
|
}
|
||||||
|
|
||||||
|
SettingsToggleRow {
|
||||||
|
tab: "theme"
|
||||||
|
tags: ["surface", "popup", "modal", "border", "outline", "edge"]
|
||||||
|
settingKey: "blurBorderEnabled"
|
||||||
|
text: I18n.tr("Surface Border Outline")
|
||||||
|
description: I18n.tr("Outline around shell surfaces")
|
||||||
|
checked: SettingsData.blurBorderEnabled ?? true
|
||||||
|
onToggled: checked => SettingsData.set("blurBorderEnabled", checked)
|
||||||
|
}
|
||||||
|
|
||||||
SettingsDropdownRow {
|
SettingsDropdownRow {
|
||||||
tab: "theme"
|
tab: "theme"
|
||||||
tags: ["surface", "popup", "modal", "border", "outline", "edge"]
|
tags: ["surface", "popup", "modal", "border", "outline", "edge"]
|
||||||
settingKey: "blurBorderColor"
|
settingKey: "blurBorderColor"
|
||||||
text: I18n.tr("Surface Border Color")
|
text: I18n.tr("Surface Border Color")
|
||||||
description: I18n.tr("Border color around popouts, modals, and other shell surfaces")
|
description: I18n.tr("Border color around popouts, modals, and other shell surfaces")
|
||||||
|
visible: SettingsData.blurBorderEnabled ?? true
|
||||||
options: [I18n.tr("Outline", "surface border color"), I18n.tr("Primary", "surface border color"), I18n.tr("Secondary", "surface border color"), I18n.tr("Text Color", "surface border color"), I18n.tr("Custom", "surface border color")]
|
options: [I18n.tr("Outline", "surface border color"), I18n.tr("Primary", "surface border color"), I18n.tr("Secondary", "surface border color"), I18n.tr("Text Color", "surface border color"), I18n.tr("Custom", "surface border color")]
|
||||||
optionColorMap: ({
|
optionColorMap: ({
|
||||||
[I18n.tr("Outline", "surface border color")]: Theme.outline,
|
[I18n.tr("Outline", "surface border color")]: Theme.outline,
|
||||||
@@ -1808,6 +1833,7 @@ Item {
|
|||||||
settingKey: "blurBorderOpacity"
|
settingKey: "blurBorderOpacity"
|
||||||
text: I18n.tr("Surface Border Opacity")
|
text: I18n.tr("Surface Border Opacity")
|
||||||
description: I18n.tr("Controls the outline of popouts, modals, and other shell surfaces")
|
description: I18n.tr("Controls the outline of popouts, modals, and other shell surfaces")
|
||||||
|
visible: SettingsData.blurBorderEnabled ?? true
|
||||||
value: Math.round((SettingsData.blurBorderOpacity ?? 0.35) * 100)
|
value: Math.round((SettingsData.blurBorderOpacity ?? 0.35) * 100)
|
||||||
minimum: 0
|
minimum: 0
|
||||||
maximum: 100
|
maximum: 100
|
||||||
@@ -1816,20 +1842,6 @@ Item {
|
|||||||
onSliderValueChanged: newValue => SettingsData.set("blurBorderOpacity", newValue / 100)
|
onSliderValueChanged: newValue => SettingsData.set("blurBorderOpacity", newValue / 100)
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsSliderRow {
|
|
||||||
tab: "theme"
|
|
||||||
tags: ["foreground", "layers", "outline", "border", "cards", "widgets", "notifications", "control center"]
|
|
||||||
settingKey: "blurLayerOutlineOpacity"
|
|
||||||
text: I18n.tr("Layer Outline Opacity")
|
|
||||||
description: I18n.tr("Controls outlines around foreground cards, pills, and notification cards")
|
|
||||||
value: Math.round((SettingsData.blurLayerOutlineOpacity ?? 0.12) * 100)
|
|
||||||
minimum: 0
|
|
||||||
maximum: 40
|
|
||||||
unit: "%"
|
|
||||||
defaultValue: 12
|
|
||||||
onSliderValueChanged: newValue => SettingsData.set("blurLayerOutlineOpacity", newValue / 100)
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsSliderRow {
|
SettingsSliderRow {
|
||||||
tab: "theme"
|
tab: "theme"
|
||||||
tags: ["corner", "radius", "rounded", "square"]
|
tags: ["corner", "radius", "rounded", "square"]
|
||||||
@@ -2102,32 +2114,6 @@ Item {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsCard {
|
|
||||||
tab: "theme"
|
|
||||||
tags: ["modal", "darken", "background", "overlay"]
|
|
||||||
title: I18n.tr("Modal Background")
|
|
||||||
settingKey: "modalBackground"
|
|
||||||
iconName: "layers"
|
|
||||||
|
|
||||||
SettingsControlledByFrame {
|
|
||||||
visible: themeColorsTab.frameModeActive
|
|
||||||
parentModal: themeColorsTab.parentModal
|
|
||||||
settingLabel: I18n.tr("Darken Modal Background")
|
|
||||||
reason: I18n.tr("Disabled by Frame Mode")
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsToggleRow {
|
|
||||||
tab: "theme"
|
|
||||||
tags: ["modal", "darken", "background", "overlay"]
|
|
||||||
settingKey: "modalDarkenBackground"
|
|
||||||
text: I18n.tr("Darken Modal Background")
|
|
||||||
description: I18n.tr("Show darkened overlay behind modal dialogs")
|
|
||||||
visible: !themeColorsTab.frameModeActive
|
|
||||||
checked: SettingsData.modalDarkenBackground
|
|
||||||
onToggled: checked => SettingsData.set("modalDarkenBackground", checked)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
SettingsCard {
|
SettingsCard {
|
||||||
tab: "theme"
|
tab: "theme"
|
||||||
tags: ["applications", "portal", "dark", "terminal"]
|
tags: ["applications", "portal", "dark", "terminal"]
|
||||||
|
|||||||
@@ -17,6 +17,8 @@ Singleton {
|
|||||||
|
|
||||||
// These settings predate non-blurred surface borders, so keep their keys for compatibility.
|
// These settings predate non-blurred surface borders, so keep their keys for compatibility.
|
||||||
readonly property color borderColor: {
|
readonly property color borderColor: {
|
||||||
|
if (!(SettingsData.blurBorderEnabled ?? true))
|
||||||
|
return "transparent";
|
||||||
const opacity = SettingsData.blurBorderOpacity ?? 0.35;
|
const opacity = SettingsData.blurBorderOpacity ?? 0.35;
|
||||||
switch (SettingsData.blurBorderColor ?? "outline") {
|
switch (SettingsData.blurBorderColor ?? "outline") {
|
||||||
case "primary":
|
case "primary":
|
||||||
@@ -26,12 +28,12 @@ Singleton {
|
|||||||
case "surfaceText":
|
case "surfaceText":
|
||||||
return Theme.withAlpha(Theme.surfaceText, opacity);
|
return Theme.withAlpha(Theme.surfaceText, opacity);
|
||||||
case "custom":
|
case "custom":
|
||||||
return Theme.withAlpha(SettingsData.blurBorderCustomColor ?? "#ffffff", opacity);
|
return Theme.withAlpha(Qt.color(SettingsData.blurBorderCustomColor ?? "#ffffff"), opacity);
|
||||||
default:
|
default:
|
||||||
return Theme.withAlpha(Theme.outline, opacity);
|
return Theme.withAlpha(Theme.outline, opacity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
readonly property int borderWidth: 1
|
readonly property int borderWidth: (SettingsData.blurBorderEnabled ?? true) ? 1 : 0
|
||||||
|
|
||||||
function hoverColor(baseColor, hoverAlpha) {
|
function hoverColor(baseColor, hoverAlpha) {
|
||||||
if (!enabled)
|
if (!enabled)
|
||||||
|
|||||||
@@ -2334,6 +2334,29 @@
|
|||||||
],
|
],
|
||||||
"icon": "extension"
|
"icon": "extension"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "modalDarkenBackground",
|
||||||
|
"label": "Darken Modal Background",
|
||||||
|
"tabIndex": 9,
|
||||||
|
"category": "Launcher",
|
||||||
|
"keywords": [
|
||||||
|
"background",
|
||||||
|
"behind",
|
||||||
|
"dark mode",
|
||||||
|
"darken",
|
||||||
|
"darkened",
|
||||||
|
"dialogs",
|
||||||
|
"drawer",
|
||||||
|
"launcher",
|
||||||
|
"menu",
|
||||||
|
"modal",
|
||||||
|
"night",
|
||||||
|
"overlay",
|
||||||
|
"show",
|
||||||
|
"start"
|
||||||
|
],
|
||||||
|
"description": "Show darkened overlay behind modal dialogs"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "launcherStyle",
|
"section": "launcherStyle",
|
||||||
"label": "Default Launcher",
|
"label": "Default Launcher",
|
||||||
@@ -2570,6 +2593,30 @@
|
|||||||
],
|
],
|
||||||
"icon": "apps"
|
"icon": "apps"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "modalBackground",
|
||||||
|
"label": "Modal Background",
|
||||||
|
"tabIndex": 9,
|
||||||
|
"category": "Launcher",
|
||||||
|
"keywords": [
|
||||||
|
"background",
|
||||||
|
"behind",
|
||||||
|
"dark mode",
|
||||||
|
"darken",
|
||||||
|
"darkened",
|
||||||
|
"dialogs",
|
||||||
|
"drawer",
|
||||||
|
"launcher",
|
||||||
|
"menu",
|
||||||
|
"modal",
|
||||||
|
"night",
|
||||||
|
"overlay",
|
||||||
|
"show",
|
||||||
|
"start"
|
||||||
|
],
|
||||||
|
"icon": "layers",
|
||||||
|
"description": "Show darkened overlay behind modal dialogs"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "spotlightCloseNiriOverview",
|
"section": "spotlightCloseNiriOverview",
|
||||||
"label": "Niri Integration",
|
"label": "Niri Integration",
|
||||||
@@ -3333,31 +3380,6 @@
|
|||||||
],
|
],
|
||||||
"description": "Base to derive dark theme from"
|
"description": "Base to derive dark theme from"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "modalDarkenBackground",
|
|
||||||
"label": "Darken Modal Background",
|
|
||||||
"tabIndex": 10,
|
|
||||||
"category": "Theme & Colors",
|
|
||||||
"keywords": [
|
|
||||||
"appearance",
|
|
||||||
"background",
|
|
||||||
"behind",
|
|
||||||
"colors",
|
|
||||||
"dark mode",
|
|
||||||
"darken",
|
|
||||||
"darkened",
|
|
||||||
"dialogs",
|
|
||||||
"look",
|
|
||||||
"modal",
|
|
||||||
"night",
|
|
||||||
"overlay",
|
|
||||||
"scheme",
|
|
||||||
"show",
|
|
||||||
"style",
|
|
||||||
"theme"
|
|
||||||
],
|
|
||||||
"description": "Show darkened overlay behind modal dialogs"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "matugenTemplateEmacs",
|
"section": "matugenTemplateEmacs",
|
||||||
"label": "Emacs",
|
"label": "Emacs",
|
||||||
@@ -3777,32 +3799,6 @@
|
|||||||
"icon": "auto_awesome",
|
"icon": "auto_awesome",
|
||||||
"conditionKey": "matugenAvailable"
|
"conditionKey": "matugenAvailable"
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "modalBackground",
|
|
||||||
"label": "Modal Background",
|
|
||||||
"tabIndex": 10,
|
|
||||||
"category": "Theme & Colors",
|
|
||||||
"keywords": [
|
|
||||||
"appearance",
|
|
||||||
"background",
|
|
||||||
"behind",
|
|
||||||
"colors",
|
|
||||||
"dark mode",
|
|
||||||
"darken",
|
|
||||||
"darkened",
|
|
||||||
"dialogs",
|
|
||||||
"look",
|
|
||||||
"modal",
|
|
||||||
"night",
|
|
||||||
"overlay",
|
|
||||||
"scheme",
|
|
||||||
"show",
|
|
||||||
"style",
|
|
||||||
"theme"
|
|
||||||
],
|
|
||||||
"icon": "layers",
|
|
||||||
"description": "Show darkened overlay behind modal dialogs"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "modalElevationEnabled",
|
"section": "modalElevationEnabled",
|
||||||
"label": "Modal Shadows",
|
"label": "Modal Shadows",
|
||||||
@@ -4090,6 +4086,30 @@
|
|||||||
],
|
],
|
||||||
"description": "Controls the outline of popouts, modals, and other shell surfaces"
|
"description": "Controls the outline of popouts, modals, and other shell surfaces"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "blurBorderEnabled",
|
||||||
|
"label": "Surface Border Outline",
|
||||||
|
"tabIndex": 10,
|
||||||
|
"category": "Theme & Colors",
|
||||||
|
"keywords": [
|
||||||
|
"appearance",
|
||||||
|
"around",
|
||||||
|
"border",
|
||||||
|
"colors",
|
||||||
|
"edge",
|
||||||
|
"look",
|
||||||
|
"modal",
|
||||||
|
"outline",
|
||||||
|
"popup",
|
||||||
|
"scheme",
|
||||||
|
"shell",
|
||||||
|
"style",
|
||||||
|
"surface",
|
||||||
|
"surfaces",
|
||||||
|
"theme"
|
||||||
|
],
|
||||||
|
"description": "Outline around shell surfaces"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "popupTransparency",
|
"section": "popupTransparency",
|
||||||
"label": "Surface Opacity",
|
"label": "Surface Opacity",
|
||||||
|
|||||||
Reference in New Issue
Block a user