Better color schemes

This commit is contained in:
quadbyte 2025-08-15 16:29:14 -04:00
parent 48b6c1cf5c
commit 67f568dac1
8 changed files with 56 additions and 32 deletions

View file

@ -45,26 +45,31 @@ ColumnLayout {
}
}
ButtonGroup {
id: schemesGroup
}
ColumnLayout {
spacing: Style.marginTiny * scaling
Layout.fillWidth: true
Repeater {
model: ColorSchemes.schemes
NRadioButton {
property string schemePath: modelData
ButtonGroup.group: schemesGroup
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)
ButtonGroup {
id: schemesGroup
}
Repeater {
model: ColorSchemes.schemes
NRadioButton {
property string schemePath: modelData
ButtonGroup.group: schemesGroup
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)
}
}
}
}