mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Predefined ColorSchemes
- added support for predefined color schemes - moved all the code regarding colors generation from wallpaper to the ColorSchemes service
This commit is contained in:
@@ -39,6 +39,19 @@ ColumnLayout {
|
||||
color: Colors.mOnSurface
|
||||
}
|
||||
|
||||
// Use Wallpaper Colors
|
||||
NToggle {
|
||||
label: "Use Wallpaper Colors"
|
||||
description: "Automatically generate colors from you active wallpaper (requires Matugen)"
|
||||
value: Settings.data.colorSchemes.useWallpaperColors
|
||||
onToggled: function (newValue) {
|
||||
Settings.data.colorSchemes.useWallpaperColors = newValue
|
||||
if (Settings.data.colorSchemes.useWallpaperColors) {
|
||||
ColorSchemes.changedWallpaper()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ButtonGroup {
|
||||
id: schemesGroup
|
||||
}
|
||||
@@ -48,9 +61,18 @@ ColumnLayout {
|
||||
NRadioButton {
|
||||
property string schemePath: modelData
|
||||
ButtonGroup.group: schemesGroup
|
||||
//checked: Audio.sink?.id === modelData.id
|
||||
//onClicked: Audio.setAudioSink(modelData)
|
||||
text: schemePath
|
||||
text: {
|
||||
// Remove json and the full path
|
||||
var chunks = schemePath.replace(".json", "").split("/")
|
||||
return chunks[chunks.length - 1]
|
||||
}
|
||||
checked: Settings.data.colorSchemes.predefinedScheme == schemePath
|
||||
onClicked: {
|
||||
// Disable useWallpaperColors when picking a predefined color scheme
|
||||
Settings.data.colorSchemes.useWallpaperColors = false
|
||||
Settings.data.colorSchemes.predefinedScheme = schemePath
|
||||
ColorSchemes.applyScheme(schemePath)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,16 +92,6 @@ ColumnLayout {
|
||||
}
|
||||
}
|
||||
|
||||
// Use Wallpaper Theme
|
||||
NToggle {
|
||||
label: "Use Wallpaper Colors"
|
||||
description: "Automatically adjust UI colors based on wallpaper using Matugen"
|
||||
value: Settings.data.wallpaper.generateColors
|
||||
onToggled: function (newValue) {
|
||||
Settings.data.wallpaper.generateColors = newValue
|
||||
}
|
||||
}
|
||||
|
||||
// Interval
|
||||
ColumnLayout {
|
||||
RowLayout {
|
||||
|
||||
Reference in New Issue
Block a user