fixup Colorpicker
This commit is contained in:
parent
52f4948275
commit
c938e0ca88
3 changed files with 12 additions and 17 deletions
|
|
@ -10,7 +10,7 @@ Singleton {
|
||||||
property alias c: colors
|
property alias c: colors
|
||||||
FileView {
|
FileView {
|
||||||
id: colorView
|
id: colorView
|
||||||
path: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/" + Config.cfg.appearance.currentTheme + ".json")
|
path: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/" + Config.cfg.appearance.currentTheme)
|
||||||
onFileChanged: {
|
onFileChanged: {
|
||||||
reload();
|
reload();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import Qt.labs.folderlistmodel 2.11
|
||||||
|
|
||||||
import qs
|
import qs
|
||||||
import qs.settings
|
import qs.settings
|
||||||
|
|
@ -19,16 +20,9 @@ Rectangle {
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
}
|
}
|
||||||
Process {
|
FolderListModel {
|
||||||
id: getSchemes
|
id: schemeModel
|
||||||
property list<string> schemes
|
folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/")
|
||||||
running: true
|
|
||||||
command: ["tinty", "list"]
|
|
||||||
stdout: SplitParser {
|
|
||||||
onRead: text => {
|
|
||||||
getSchemes.schemes.push(text);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
@ -45,11 +39,12 @@ Rectangle {
|
||||||
id: schemeList
|
id: schemeList
|
||||||
spacing: 5
|
spacing: 5
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
model: getSchemes.schemes
|
model: schemeModel
|
||||||
implicitWidth: 300
|
implicitWidth: 300
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
id: container
|
id: container
|
||||||
required property string modelData
|
required property var modelData
|
||||||
|
|
||||||
color: Colors.c.base02
|
color: Colors.c.base02
|
||||||
height: 30
|
height: 30
|
||||||
radius: Config.cfg.appearance.rounding
|
radius: Config.cfg.appearance.rounding
|
||||||
|
|
@ -57,7 +52,7 @@ Rectangle {
|
||||||
StyledText {
|
StyledText {
|
||||||
id: schemeName
|
id: schemeName
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: container.modelData
|
text: container.modelData.fileName
|
||||||
}
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: schemeSetter
|
id: schemeSetter
|
||||||
|
|
@ -65,9 +60,9 @@ Rectangle {
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.LeftButton
|
||||||
cursorShape: Qt.PointingHandCursor
|
cursorShape: Qt.PointingHandCursor
|
||||||
onClicked: {
|
onClicked: {
|
||||||
setTheme.themeName = modelData;
|
setTheme.themeName = modelData.fileName;
|
||||||
setTheme.running = true;
|
setTheme.running = true;
|
||||||
Config.cfg.appearance.currentTheme = modelData;
|
Config.cfg.appearance.currentTheme = modelData.fileName;
|
||||||
}
|
}
|
||||||
Process {
|
Process {
|
||||||
id: setTheme
|
id: setTheme
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"appearance": {
|
"appearance": {
|
||||||
"currentTheme": "base16-github-dark",
|
"currentTheme": "base16-catppuccin-mocha.json",
|
||||||
"font": "Roboto Medium",
|
"font": "Roboto Medium",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"iconSize": 14,
|
"iconSize": 14,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue