make theme picker searchable

This commit is contained in:
lucy 2026-09-16 00:13:02 +02:00
commit dfd80441e0
4 changed files with 30 additions and 15 deletions

View file

@ -3,6 +3,8 @@ import Quickshell
import Quickshell.Io
import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import QtQml.Models
import Qt.labs.folderlistmodel 2.11
import qs
@ -12,29 +14,46 @@ import qs.modules.Services
Rectangle {
id: child
implicitWidth: 800
implicitWidth: contentLayout.implicitWidth + contentLayout.anchors.margins * 2+ container.anchors.margins * 2
implicitHeight: 600
color: Colors.c.base01
color: Colors.c.base00
radius: Config.cfg.appearance.rounding
MouseArea {
acceptedButtons: Qt.AllButtons
anchors.fill: parent
}
FolderListModel {
id: schemeModel
folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/")
id: schemeModel
folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/")
nameFilters: searchBar.text == "" ? [] : ["*" + searchBar.text + "*"]
}
Rectangle {
id: container
anchors.fill: parent
anchors.centerIn: parent
anchors.margins: 10
radius: Config.cfg.appearance.rounding
color: Colors.c.base01
color: Colors.c.base00
clip: true
RowLayout {
ColumnLayout {
id: contentLayout
anchors.fill: parent
anchors.margins: 30
anchors.centerIn: parent
spacing: 40
TextField {
id: searchBar
placeholderText: "enter scheme name:"
placeholderTextColor: Colors.c.base04
leftPadding: 10
background: Rectangle {
color: Colors.c.base02
implicitWidth: 300
implicitHeight: 30
radius: Config.cfg.appearance.rounding
}
}
ListView {
id: schemeList
spacing: 5
@ -44,7 +63,7 @@ Rectangle {
delegate: Rectangle {
id: container
required property var modelData
color: Colors.c.base02
height: 30
radius: Config.cfg.appearance.rounding
@ -72,10 +91,6 @@ Rectangle {
}
}
}
StyledText {
id: currentScheme
text: Config.cfg.appearance.currentTheme
}
}
}
}