mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-08-03 20:18:31 -04:00
theme: large consolidation of colors into Theme.qml, add
surfaceContainerLow/Lowest
This commit is contained in:
@@ -1,6 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import Quickshell
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -16,17 +14,17 @@ PluginComponent {
|
||||
ccWidgetPrimaryText: "Detail Example"
|
||||
ccWidgetSecondaryText: {
|
||||
if (isEnabled) {
|
||||
const selected = pluginData.selectedOption || "Option A"
|
||||
return selected
|
||||
const selected = pluginData.selectedOption || "Option A";
|
||||
return selected;
|
||||
}
|
||||
return "Disabled"
|
||||
return "Disabled";
|
||||
}
|
||||
ccWidgetIsActive: isEnabled
|
||||
|
||||
onCcWidgetToggled: {
|
||||
isEnabled = !isEnabled
|
||||
isEnabled = !isEnabled;
|
||||
if (pluginService) {
|
||||
pluginService.savePluginData("controlCenterDetailExample", "isEnabled", isEnabled)
|
||||
pluginService.savePluginData("controlCenterDetailExample", "isEnabled", isEnabled);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -68,8 +66,8 @@ PluginComponent {
|
||||
width: parent.width
|
||||
height: 40
|
||||
radius: Theme.cornerRadius
|
||||
color: optionMouseArea.containsMouse ? Theme.surfaceContainerHighest : "transparent"
|
||||
border.color: detailRoot.currentSelection === modelData ? Theme.primary : "transparent"
|
||||
color: optionMouseArea.containsMouse ? Theme.surfaceContainerHighest : Theme.withAlpha(Theme.surfaceContainerHighest, 0)
|
||||
border.color: detailRoot.currentSelection === modelData ? Theme.primary : Theme.withAlpha(Theme.primary, 0)
|
||||
border.width: detailRoot.currentSelection === modelData ? 2 : 0
|
||||
|
||||
MouseArea {
|
||||
@@ -79,10 +77,10 @@ PluginComponent {
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
z: 100
|
||||
onClicked: {
|
||||
SettingsData.setPluginSetting("controlCenterDetailExample", "selectedOption", modelData)
|
||||
detailRoot.currentSelection = modelData
|
||||
PluginService.pluginDataChanged("controlCenterDetailExample")
|
||||
ToastService.showInfo("Option Selected", modelData)
|
||||
SettingsData.setPluginSetting("controlCenterDetailExample", "selectedOption", modelData);
|
||||
detailRoot.currentSelection = modelData;
|
||||
PluginService.pluginDataChanged("controlCenterDetailExample");
|
||||
ToastService.showInfo("Option Selected", modelData);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,8 +124,8 @@ PluginComponent {
|
||||
|
||||
StyledText {
|
||||
text: {
|
||||
const selected = root.pluginData.selectedOption || "Option A"
|
||||
return selected.substring(0, 1)
|
||||
const selected = root.pluginData.selectedOption || "Option A";
|
||||
return selected.substring(0, 1);
|
||||
}
|
||||
color: root.isEnabled ? Theme.primary : Theme.surfaceVariantText
|
||||
font.pixelSize: Theme.fontSizeMedium
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import qs.Common
|
||||
import qs.Services
|
||||
import qs.Widgets
|
||||
@@ -10,9 +9,9 @@ PluginSettings {
|
||||
pluginId: "exampleVariants"
|
||||
|
||||
onVariantsChanged: {
|
||||
variantsModel.clear()
|
||||
variantsModel.clear();
|
||||
for (var i = 0; i < variants.length; i++) {
|
||||
variantsModel.append(variants[i])
|
||||
variantsModel.append(variants[i]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -112,21 +111,21 @@ PluginSettings {
|
||||
iconName: "add"
|
||||
onClicked: {
|
||||
if (!nameField.text) {
|
||||
ToastService.showError("Please enter a variant name")
|
||||
return
|
||||
ToastService.showError("Please enter a variant name");
|
||||
return;
|
||||
}
|
||||
|
||||
var variantConfig = {
|
||||
text: textField.text || nameField.text,
|
||||
icon: iconField.text || "widgets"
|
||||
}
|
||||
};
|
||||
|
||||
createVariant(nameField.text, variantConfig)
|
||||
ToastService.showInfo("Variant created: " + nameField.text)
|
||||
createVariant(nameField.text, variantConfig);
|
||||
ToastService.showInfo("Variant created: " + nameField.text);
|
||||
|
||||
nameField.text = ""
|
||||
iconField.text = ""
|
||||
textField.text = ""
|
||||
nameField.text = "";
|
||||
iconField.text = "";
|
||||
textField.text = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,7 +216,7 @@ PluginSettings {
|
||||
width: 32
|
||||
height: 32
|
||||
radius: 16
|
||||
color: deleteArea.containsMouse ? Theme.error : "transparent"
|
||||
color: deleteArea.containsMouse ? Theme.error : Theme.withAlpha(Theme.error, 0)
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
DankIcon {
|
||||
@@ -233,8 +232,8 @@ PluginSettings {
|
||||
hoverEnabled: true
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
removeVariant(model.id)
|
||||
ToastService.showInfo("Variant removed: " + model.name)
|
||||
removeVariant(model.id);
|
||||
ToastService.showInfo("Variant removed: " + model.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,6 +44,7 @@ Theme.cornerRadiusLarge // Larger radius
|
||||
### Surface Colors
|
||||
```qml
|
||||
Theme.surface
|
||||
Theme.surfaceContainerLowest
|
||||
Theme.surfaceContainerLow
|
||||
Theme.surfaceContainer
|
||||
Theme.surfaceContainerHigh
|
||||
|
||||
Reference in New Issue
Block a user