mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-06-17 16:45:19 -04:00
add: DankColorSwatch component & settings sync
This commit is contained in:
@@ -0,0 +1,45 @@
|
|||||||
|
import QtQuick
|
||||||
|
import qs.Common
|
||||||
|
|
||||||
|
Item {
|
||||||
|
id: root
|
||||||
|
|
||||||
|
property color swatchColor: "transparent"
|
||||||
|
property color ringColor: Theme.outline
|
||||||
|
property real minPreviewAlpha: 0.4
|
||||||
|
readonly property bool translucent: swatchColor.a > 0 && swatchColor.a < 1
|
||||||
|
readonly property color displayColor: translucent ? Qt.rgba(swatchColor.r, swatchColor.g, swatchColor.b, Math.max(swatchColor.a, minPreviewAlpha)) : swatchColor
|
||||||
|
|
||||||
|
Loader {
|
||||||
|
anchors.fill: parent
|
||||||
|
active: root.translucent
|
||||||
|
sourceComponent: Component {
|
||||||
|
Canvas {
|
||||||
|
onPaint: {
|
||||||
|
const ctx = getContext("2d");
|
||||||
|
ctx.reset();
|
||||||
|
ctx.beginPath();
|
||||||
|
ctx.arc(width / 2, height / 2, width / 2, 0, 2 * Math.PI);
|
||||||
|
ctx.clip();
|
||||||
|
const s = Math.max(2, Math.round(width / 4));
|
||||||
|
for (let y = 0; y < height; y += s) {
|
||||||
|
for (let x = 0; x < width; x += s) {
|
||||||
|
ctx.fillStyle = (((x / s) + (y / s)) % 2 === 0) ? "#ffffff" : "#bdbdbd";
|
||||||
|
ctx.fillRect(x, y, s, s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
onVisibleChanged: if (visible)
|
||||||
|
requestPaint()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
radius: width / 2
|
||||||
|
color: root.displayColor
|
||||||
|
border.color: root.ringColor
|
||||||
|
border.width: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -161,19 +161,14 @@ Item {
|
|||||||
anchors.rightMargin: Theme.spacingS
|
anchors.rightMargin: Theme.spacingS
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
Rectangle {
|
DankColorSwatch {
|
||||||
id: triggerSwatch
|
id: triggerSwatch
|
||||||
|
|
||||||
property var swatchColor: root.optionColorMap[root.currentValue]
|
|
||||||
|
|
||||||
width: 16
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
radius: 8
|
|
||||||
color: swatchColor !== undefined ? swatchColor : "transparent"
|
|
||||||
border.color: Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: swatchColor !== undefined
|
visible: root.optionColorMap[root.currentValue] !== undefined
|
||||||
|
swatchColor: visible ? root.optionColorMap[root.currentValue] : "transparent"
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
@@ -473,17 +468,15 @@ Item {
|
|||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
spacing: Theme.spacingS
|
spacing: Theme.spacingS
|
||||||
|
|
||||||
Rectangle {
|
DankColorSwatch {
|
||||||
id: optionSwatch
|
id: optionSwatch
|
||||||
|
|
||||||
width: 16
|
width: 16
|
||||||
height: 16
|
height: 16
|
||||||
radius: 8
|
|
||||||
color: delegateRoot.swatchColor !== undefined ? delegateRoot.swatchColor : "transparent"
|
|
||||||
border.color: delegateRoot.isCurrentValue ? Theme.primary : Theme.outline
|
|
||||||
border.width: 1
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
visible: delegateRoot.swatchColor !== undefined
|
visible: delegateRoot.swatchColor !== undefined
|
||||||
|
swatchColor: visible ? delegateRoot.swatchColor : "transparent"
|
||||||
|
ringColor: delegateRoot.isCurrentValue ? Theme.primary : Theme.outline
|
||||||
}
|
}
|
||||||
|
|
||||||
DankIcon {
|
DankIcon {
|
||||||
|
|||||||
@@ -2088,7 +2088,8 @@
|
|||||||
"appearance",
|
"appearance",
|
||||||
"around",
|
"around",
|
||||||
"bar",
|
"bar",
|
||||||
"border",
|
"color",
|
||||||
|
"custom",
|
||||||
"dank",
|
"dank",
|
||||||
"desktop",
|
"desktop",
|
||||||
"focused",
|
"focused",
|
||||||
@@ -2103,8 +2104,7 @@
|
|||||||
"workspace"
|
"workspace"
|
||||||
],
|
],
|
||||||
"icon": "palette",
|
"icon": "palette",
|
||||||
"description": "Show an outline ring around the focused workspace indicator",
|
"description": "Show an outline ring around the focused workspace indicator"
|
||||||
"conditionKey": "isNiri"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"section": "_tab_7",
|
"section": "_tab_7",
|
||||||
@@ -3180,6 +3180,33 @@
|
|||||||
"description": "Mouse pointer appearance",
|
"description": "Mouse pointer appearance",
|
||||||
"conditionKey": "isNiri"
|
"conditionKey": "isNiri"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "widgetBackgroundCustomStrength",
|
||||||
|
"label": "Custom Blend",
|
||||||
|
"tabIndex": 10,
|
||||||
|
"category": "Theme & Colors",
|
||||||
|
"keywords": [
|
||||||
|
"appearance",
|
||||||
|
"background",
|
||||||
|
"between",
|
||||||
|
"blend",
|
||||||
|
"color",
|
||||||
|
"colors",
|
||||||
|
"colour",
|
||||||
|
"custom",
|
||||||
|
"high",
|
||||||
|
"hue",
|
||||||
|
"look",
|
||||||
|
"scheme",
|
||||||
|
"selected",
|
||||||
|
"style",
|
||||||
|
"surface",
|
||||||
|
"theme",
|
||||||
|
"tint",
|
||||||
|
"widget"
|
||||||
|
],
|
||||||
|
"description": "Blend between Surface High and the selected custom color"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "matugenTemplateNeovimSettings",
|
"section": "matugenTemplateNeovimSettings",
|
||||||
"label": "Dark mode base",
|
"label": "Dark mode base",
|
||||||
@@ -4045,78 +4072,59 @@
|
|||||||
"wezterm"
|
"wezterm"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"section": "widgetBackgroundColor",
|
|
||||||
"label": "Widget Background Color",
|
|
||||||
"tabIndex": 10,
|
|
||||||
"category": "Theme & Colors",
|
|
||||||
"keywords": [
|
|
||||||
"appearance",
|
|
||||||
"background",
|
|
||||||
"choose",
|
|
||||||
"color",
|
|
||||||
"colors",
|
|
||||||
"colour",
|
|
||||||
"components",
|
|
||||||
"hue",
|
|
||||||
"look",
|
|
||||||
"modules",
|
|
||||||
"scheme",
|
|
||||||
"style",
|
|
||||||
"theme",
|
|
||||||
"tint",
|
|
||||||
"widget",
|
|
||||||
"widgets"
|
|
||||||
],
|
|
||||||
"description": "Choose the background color for widgets"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"section": "widgetColorMode",
|
|
||||||
"label": "Widget Style",
|
|
||||||
"tabIndex": 10,
|
|
||||||
"category": "Theme & Colors",
|
|
||||||
"keywords": [
|
|
||||||
"appearance",
|
|
||||||
"change",
|
|
||||||
"colorful",
|
|
||||||
"colors",
|
|
||||||
"default",
|
|
||||||
"look",
|
|
||||||
"panel",
|
|
||||||
"scheme",
|
|
||||||
"statusbar",
|
|
||||||
"style",
|
|
||||||
"taskbar",
|
|
||||||
"theme",
|
|
||||||
"topbar",
|
|
||||||
"widget"
|
|
||||||
],
|
|
||||||
"description": "Change bar appearance"
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
"section": "widgetStyling",
|
"section": "widgetStyling",
|
||||||
"label": "Widget Styling",
|
"label": "Widget Styling",
|
||||||
"tabIndex": 10,
|
"tabIndex": 10,
|
||||||
"category": "Theme & Colors",
|
"category": "Theme & Colors",
|
||||||
"keywords": [
|
"keywords": [
|
||||||
|
"accent",
|
||||||
"appearance",
|
"appearance",
|
||||||
"change",
|
"choose",
|
||||||
|
"colored",
|
||||||
"colors",
|
"colors",
|
||||||
|
"colour",
|
||||||
|
"hue",
|
||||||
"look",
|
"look",
|
||||||
|
"neutral",
|
||||||
"opacity",
|
"opacity",
|
||||||
"panel",
|
|
||||||
"scheme",
|
"scheme",
|
||||||
"statusbar",
|
|
||||||
"style",
|
"style",
|
||||||
"styling",
|
"styling",
|
||||||
"taskbar",
|
"text",
|
||||||
"theme",
|
"theme",
|
||||||
"topbar",
|
"tint",
|
||||||
"transparency",
|
"transparency",
|
||||||
"widget"
|
"widget"
|
||||||
],
|
],
|
||||||
"icon": "opacity",
|
"icon": "opacity",
|
||||||
"description": "Change bar appearance"
|
"description": "Choose neutral or accent-colored widget text"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"section": "widgetColorMode",
|
||||||
|
"label": "Widget Text Style",
|
||||||
|
"tabIndex": 10,
|
||||||
|
"category": "Theme & Colors",
|
||||||
|
"keywords": [
|
||||||
|
"accent",
|
||||||
|
"appearance",
|
||||||
|
"choose",
|
||||||
|
"colored",
|
||||||
|
"colorful",
|
||||||
|
"colors",
|
||||||
|
"colour",
|
||||||
|
"default",
|
||||||
|
"hue",
|
||||||
|
"look",
|
||||||
|
"neutral",
|
||||||
|
"scheme",
|
||||||
|
"style",
|
||||||
|
"text",
|
||||||
|
"theme",
|
||||||
|
"tint",
|
||||||
|
"widget"
|
||||||
|
],
|
||||||
|
"description": "Choose neutral or accent-colored widget text"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"section": "matugenTemplateZed",
|
"section": "matugenTemplateZed",
|
||||||
@@ -5295,6 +5303,30 @@
|
|||||||
],
|
],
|
||||||
"description": "Play sound after logging in"
|
"description": "Play sound after logging in"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"section": "muteSoundsWhenMediaPlaying",
|
||||||
|
"label": "Mute During Playback",
|
||||||
|
"tabIndex": 15,
|
||||||
|
"category": "Sounds",
|
||||||
|
"keywords": [
|
||||||
|
"audio",
|
||||||
|
"during",
|
||||||
|
"effects",
|
||||||
|
"media",
|
||||||
|
"mpris",
|
||||||
|
"music",
|
||||||
|
"mute",
|
||||||
|
"playback",
|
||||||
|
"playing",
|
||||||
|
"sfx",
|
||||||
|
"silence",
|
||||||
|
"sound",
|
||||||
|
"sounds",
|
||||||
|
"system",
|
||||||
|
"while"
|
||||||
|
],
|
||||||
|
"description": "Silence system sounds while media is playing"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"section": "soundNewNotification",
|
"section": "soundNewNotification",
|
||||||
"label": "New Notification",
|
"label": "New Notification",
|
||||||
|
|||||||
Reference in New Issue
Block a user