1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-05 21:15:38 -05:00

theme: add colorful bar widget option

This commit is contained in:
bbedward
2025-11-21 00:07:23 -05:00
parent 46caeb0445
commit dfe2f3771b
27 changed files with 170 additions and 84 deletions

View File

@@ -44,6 +44,11 @@ Singleton {
SuspendThenHibernate
}
enum WidgetColorMode {
Default,
Colorful
}
readonly property string defaultFontFamily: "Inter Variable"
readonly property string defaultMonoFontFamily: "Fira Code"
readonly property string _homeUrl: StandardPaths.writableLocation(StandardPaths.HomeLocation)
@@ -70,6 +75,7 @@ Singleton {
property real popupTransparency: 1.0
property real dockTransparency: 1
property string widgetBackgroundColor: "sch"
property string widgetColorMode: "default"
property real cornerRadius: 12
property bool use24HourClock: true

View File

@@ -665,6 +665,34 @@ Singleton {
}
}
property color widgetIconColor: {
if (typeof SettingsData === "undefined") {
return surfaceText
}
switch (SettingsData.widgetColorMode) {
case "colorful":
return surfaceText
case "default":
default:
return surfaceText
}
}
property color widgetTextColor: {
if (typeof SettingsData === "undefined") {
return surfaceText
}
switch (SettingsData.widgetColorMode) {
case "colorful":
return primary
case "default":
default:
return surfaceText
}
}
function isColorDark(c) {
return (0.299 * c.r + 0.587 * c.g + 0.114 * c.b) < 0.5

View File

@@ -18,6 +18,7 @@ var SPEC = {
dockTransparency: { def: 1.0, coerce: percentToUnit },
widgetBackgroundColor: { def: "sch" },
widgetColorMode: { def: "default" },
cornerRadius: { def: 12, onChange: "updateNiriLayout" },
use24HourClock: { def: true },