ColorScheme: selector wip
This commit is contained in:
parent
39cc72f067
commit
b79744c135
3 changed files with 40 additions and 65 deletions
|
|
@ -9,27 +9,6 @@ ColumnLayout {
|
|||
|
||||
spacing: 0
|
||||
|
||||
// Component.onCompleted: {
|
||||
// console.log("[ColorSchemes] Service initialized")
|
||||
// ColorScheme.loadColorSchemes()
|
||||
// }
|
||||
|
||||
|
||||
// property var colorSchemes: [{
|
||||
// "label": "Generated from Wallpaper (Matugen required)"
|
||||
// }, {
|
||||
// "label": "Catppuccin"
|
||||
// }, {
|
||||
// "label": "Dracula"
|
||||
// }, {
|
||||
// "label": "Gruvbox"
|
||||
// }, {
|
||||
// "label": "Nord"
|
||||
// "file": "nord.json"
|
||||
// }, , {
|
||||
// "label": "Rosé Pine",
|
||||
// "file": "rosepine.json"
|
||||
// }]
|
||||
ScrollView {
|
||||
id: scrollView
|
||||
|
||||
|
|
@ -66,17 +45,14 @@ ColumnLayout {
|
|||
|
||||
Repeater {
|
||||
model: ColorSchemes.schemes
|
||||
delegate: NRadioButton {
|
||||
NRadioButton {
|
||||
property string schemePath: modelData
|
||||
ButtonGroup.group: schemesGroup
|
||||
// checked: Audio.sink?.id === modelData.id
|
||||
//checked: Audio.sink?.id === modelData.id
|
||||
//onClicked: Audio.setAudioSink(modelData)
|
||||
text: {
|
||||
console.log(modelData.fileName)
|
||||
return modelData.fileName
|
||||
text: schemePath
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,42 +8,41 @@ import Quickshell.Io
|
|||
Singleton {
|
||||
id: root
|
||||
|
||||
// Component.onCompleted: {
|
||||
// console.log("[ColorSchemes] Service initialized")
|
||||
// loadColorSchemes()
|
||||
// }
|
||||
Component.onCompleted: {
|
||||
console.log("[ColorSchemes] Service initialized")
|
||||
loadColorSchemes()
|
||||
}
|
||||
|
||||
// property var schemes: []
|
||||
property var schemes: []
|
||||
property string baseDirectory: "file://" + Quickshell.shellDir + "/Assets/ColorSchemes"
|
||||
// //property string currentScheme: Settings.data.wallpaper.current
|
||||
// property bool scanning: false
|
||||
property bool scanning: false
|
||||
|
||||
// function loadColorSchemes() {
|
||||
// scanning = true
|
||||
// schemes = []
|
||||
// // Unsetting, then setting the folder will re-trigger the parsing!
|
||||
// folderModel.folder = ""
|
||||
// folderModel.folder = "file://" + Quickshell.shellDir + "/Assets/Matugen/ColorSchemes"
|
||||
// }
|
||||
function loadColorSchemes() {
|
||||
console.log("[ColorSchemes] Load ColorSchemes")
|
||||
scanning = true
|
||||
schemes = []
|
||||
// Unsetting, then setting the folder will re-trigger the parsing!
|
||||
folderModel.folder = ""
|
||||
folderModel.folder = baseDirectory
|
||||
}
|
||||
|
||||
// FolderListModel {
|
||||
// id: folderModel
|
||||
// nameFilters: ["*.json"]
|
||||
// showDirs: false
|
||||
// sortField: FolderListModel.Name
|
||||
// onStatusChanged: {
|
||||
// console.log("sasfjsaflkhfkjhasf")
|
||||
// if (status === FolderListModel.Ready) {
|
||||
// var files = []
|
||||
// for (var i = 0; i < count; i++) {
|
||||
// console.log(get(i, "fileName"))
|
||||
// // var filepath = (Settings.data.wallpaper.directory !== undefined ? Settings.data.wallpaper.directory : "") + "/" + get(
|
||||
// // i, "fileName")
|
||||
// // files.push(filepath)
|
||||
// }
|
||||
// schemes = files
|
||||
// scanning = false
|
||||
// console.log(schemes)
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
FolderListModel {
|
||||
id: folderModel
|
||||
nameFilters: ["*.json"]
|
||||
showDirs: false
|
||||
sortField: FolderListModel.Name
|
||||
onStatusChanged: {
|
||||
if (status === FolderListModel.Ready) {
|
||||
var files = []
|
||||
for (var i = 0; i < count; i++) {
|
||||
var filepath = baseDirectory + "/" + get(i, "fileName")
|
||||
files.push(filepath)
|
||||
}
|
||||
schemes = files
|
||||
scanning = false
|
||||
console.log(schemes)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ Singleton {
|
|||
scanning = true
|
||||
wallpaperList = []
|
||||
// Unsetting, then setting the folder will re-trigger the parsing!
|
||||
folderModel.folder = "";
|
||||
folderModel.folder = ""
|
||||
folderModel.folder = "file://" + (Settings.data.wallpaper.directory !== undefined ? Settings.data.wallpaper.directory : "")
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue