ColorScheme: selector wip

This commit is contained in:
quadbyte 2025-08-15 00:09:03 -04:00
parent 39cc72f067
commit b79744c135
3 changed files with 40 additions and 65 deletions

View file

@ -9,27 +9,6 @@ ColumnLayout {
spacing: 0 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 { ScrollView {
id: scrollView id: scrollView
@ -66,16 +45,13 @@ ColumnLayout {
Repeater { Repeater {
model: ColorSchemes.schemes model: ColorSchemes.schemes
delegate: NRadioButton { NRadioButton {
property string schemePath: modelData
ButtonGroup.group: schemesGroup ButtonGroup.group: schemesGroup
// checked: Audio.sink?.id === modelData.id //checked: Audio.sink?.id === modelData.id
//onClicked: Audio.setAudioSink(modelData) //onClicked: Audio.setAudioSink(modelData)
text: { text: schemePath
console.log(modelData.fileName)
return modelData.fileName
}
} }
} }
} }
} }

View file

@ -8,42 +8,41 @@ import Quickshell.Io
Singleton { Singleton {
id: root id: root
// Component.onCompleted: { Component.onCompleted: {
// console.log("[ColorSchemes] Service initialized") console.log("[ColorSchemes] Service initialized")
// loadColorSchemes() loadColorSchemes()
// } }
// property var schemes: [] property var schemes: []
property string baseDirectory: "file://" + Quickshell.shellDir + "/Assets/ColorSchemes"
// //property string currentScheme: Settings.data.wallpaper.current // //property string currentScheme: Settings.data.wallpaper.current
// property bool scanning: false property bool scanning: false
// function loadColorSchemes() { function loadColorSchemes() {
// scanning = true console.log("[ColorSchemes] Load ColorSchemes")
// schemes = [] scanning = true
// // Unsetting, then setting the folder will re-trigger the parsing! schemes = []
// folderModel.folder = "" // Unsetting, then setting the folder will re-trigger the parsing!
// folderModel.folder = "file://" + Quickshell.shellDir + "/Assets/Matugen/ColorSchemes" folderModel.folder = ""
// } folderModel.folder = baseDirectory
}
// FolderListModel { FolderListModel {
// id: folderModel id: folderModel
// nameFilters: ["*.json"] nameFilters: ["*.json"]
// showDirs: false showDirs: false
// sortField: FolderListModel.Name sortField: FolderListModel.Name
// onStatusChanged: { onStatusChanged: {
// console.log("sasfjsaflkhfkjhasf") if (status === FolderListModel.Ready) {
// if (status === FolderListModel.Ready) { var files = []
// var files = [] for (var i = 0; i < count; i++) {
// for (var i = 0; i < count; i++) { var filepath = baseDirectory + "/" + get(i, "fileName")
// console.log(get(i, "fileName")) files.push(filepath)
// // var filepath = (Settings.data.wallpaper.directory !== undefined ? Settings.data.wallpaper.directory : "") + "/" + get( }
// // i, "fileName") schemes = files
// // files.push(filepath) scanning = false
// } console.log(schemes)
// schemes = files }
// scanning = false }
// console.log(schemes) }
// }
// }
// }
} }

View file

@ -21,13 +21,13 @@ Singleton {
property bool scanning: false property bool scanning: false
property string transitionType: Settings.data.wallpaper.swww.transitionType property string transitionType: Settings.data.wallpaper.swww.transitionType
property var randomChoices: ["simple", "fade", "left", "right", "top", "bottom", "wipe", "wave", "grow", "center", "any", "outer"] property var randomChoices: ["simple", "fade", "left", "right", "top", "bottom", "wipe", "wave", "grow", "center", "any", "outer"]
function loadWallpapers() { function loadWallpapers() {
console.log("[Wallpapers] Load Wallpapers") console.log("[Wallpapers] Load Wallpapers")
scanning = true scanning = true
wallpaperList = [] wallpaperList = []
// Unsetting, then setting the folder will re-trigger the parsing! // 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 : "") folderModel.folder = "file://" + (Settings.data.wallpaper.directory !== undefined ? Settings.data.wallpaper.directory : "")
} }
@ -126,7 +126,7 @@ Singleton {
} }
wallpaperList = files wallpaperList = files
scanning = false scanning = false
console.log("[Wallpapers] List refreshed, count:", wallpaperList.length) console.log("[Wallpapers] List refreshed, count:", wallpaperList.length)
} }
} }
} }