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

feat: Rebuilt DankColorPicker w/Color Sampling

- Fully custom built ColorDialog
- Replaces previous Wallpaper background color tool
- Requires hyprpicker for color sampling, thanks @Vaxry
This commit is contained in:
purian23
2025-10-05 22:18:26 -04:00
parent 2dc310dcbc
commit 523422cf6c
6 changed files with 599 additions and 213 deletions

View File

@@ -70,6 +70,7 @@ Singleton {
property int batteryHibernateTimeout: 0 // Never
property bool lockBeforeSuspend: false
property var recentColors: []
Component.onCompleted: {
@@ -150,6 +151,7 @@ Singleton {
batterySuspendTimeout = settings.batterySuspendTimeout !== undefined ? settings.batterySuspendTimeout : 0
batteryHibernateTimeout = settings.batteryHibernateTimeout !== undefined ? settings.batteryHibernateTimeout : 0
lockBeforeSuspend = settings.lockBeforeSuspend !== undefined ? settings.lockBeforeSuspend : false
recentColors = settings.recentColors !== undefined ? settings.recentColors : []
if (!isGreeterMode) {
if (typeof Theme !== "undefined") {
@@ -210,7 +212,8 @@ Singleton {
"batteryLockTimeout": batteryLockTimeout,
"batterySuspendTimeout": batterySuspendTimeout,
"batteryHibernateTimeout": batteryHibernateTimeout,
"lockBeforeSuspend": lockBeforeSuspend
"lockBeforeSuspend": lockBeforeSuspend,
"recentColors": recentColors
}, null, 2))
}
@@ -359,6 +362,16 @@ Singleton {
saveSettings()
}
function addRecentColor(color) {
const colorStr = color.toString()
let recent = recentColors.slice()
recent = recent.filter(c => c !== colorStr)
recent.unshift(colorStr)
if (recent.length > 5) recent = recent.slice(0, 5)
recentColors = recent
saveSettings()
}
function addPinnedApp(appId) {
if (!appId)
return