fixup Colorpicker

This commit is contained in:
lucy 2026-09-11 01:32:58 +02:00
commit c938e0ca88
3 changed files with 12 additions and 17 deletions

View file

@ -10,7 +10,7 @@ Singleton {
property alias c: colors
FileView {
id: colorView
path: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/" + Config.cfg.appearance.currentTheme + ".json")
path: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/" + Config.cfg.appearance.currentTheme)
onFileChanged: {
reload();
}

View file

@ -3,6 +3,7 @@ import Quickshell
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import Qt.labs.folderlistmodel 2.11
import qs
import qs.settings
@ -19,16 +20,9 @@ Rectangle {
acceptedButtons: Qt.AllButtons
anchors.fill: parent
}
Process {
id: getSchemes
property list<string> schemes
running: true
command: ["tinty", "list"]
stdout: SplitParser {
onRead: text => {
getSchemes.schemes.push(text);
}
}
FolderListModel {
id: schemeModel
folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/")
}
Rectangle {
anchors.fill: parent
@ -45,11 +39,12 @@ Rectangle {
id: schemeList
spacing: 5
Layout.fillHeight: true
model: getSchemes.schemes
model: schemeModel
implicitWidth: 300
delegate: Rectangle {
id: container
required property string modelData
required property var modelData
color: Colors.c.base02
height: 30
radius: Config.cfg.appearance.rounding
@ -57,7 +52,7 @@ Rectangle {
StyledText {
id: schemeName
anchors.centerIn: parent
text: container.modelData
text: container.modelData.fileName
}
MouseArea {
id: schemeSetter
@ -65,9 +60,9 @@ Rectangle {
acceptedButtons: Qt.LeftButton
cursorShape: Qt.PointingHandCursor
onClicked: {
setTheme.themeName = modelData;
setTheme.themeName = modelData.fileName;
setTheme.running = true;
Config.cfg.appearance.currentTheme = modelData;
Config.cfg.appearance.currentTheme = modelData.fileName;
}
Process {
id: setTheme

View file

@ -1,6 +1,6 @@
{
"appearance": {
"currentTheme": "base16-github-dark",
"currentTheme": "base16-catppuccin-mocha.json",
"font": "Roboto Medium",
"fontSize": 14,
"iconSize": 14,