make theme picker searchable
This commit is contained in:
parent
0bc8d5f13a
commit
dfd80441e0
4 changed files with 30 additions and 15 deletions
|
|
@ -3,6 +3,8 @@ import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Layouts
|
import QtQuick.Layouts
|
||||||
|
import QtQuick.Controls
|
||||||
|
import QtQml.Models
|
||||||
import Qt.labs.folderlistmodel 2.11
|
import Qt.labs.folderlistmodel 2.11
|
||||||
|
|
||||||
import qs
|
import qs
|
||||||
|
|
@ -12,9 +14,9 @@ import qs.modules.Services
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: child
|
id: child
|
||||||
implicitWidth: 800
|
implicitWidth: contentLayout.implicitWidth + contentLayout.anchors.margins * 2+ container.anchors.margins * 2
|
||||||
implicitHeight: 600
|
implicitHeight: 600
|
||||||
color: Colors.c.base01
|
color: Colors.c.base00
|
||||||
radius: Config.cfg.appearance.rounding
|
radius: Config.cfg.appearance.rounding
|
||||||
MouseArea {
|
MouseArea {
|
||||||
acceptedButtons: Qt.AllButtons
|
acceptedButtons: Qt.AllButtons
|
||||||
|
|
@ -23,18 +25,35 @@ Rectangle {
|
||||||
FolderListModel {
|
FolderListModel {
|
||||||
id: schemeModel
|
id: schemeModel
|
||||||
folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/")
|
folder: Qt.resolvedUrl(Quickshell.shellDir + "/schemes/")
|
||||||
|
nameFilters: searchBar.text == "" ? [] : ["*" + searchBar.text + "*"]
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
id: container
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
anchors.margins: 10
|
anchors.margins: 10
|
||||||
radius: Config.cfg.appearance.rounding
|
radius: Config.cfg.appearance.rounding
|
||||||
color: Colors.c.base01
|
color: Colors.c.base00
|
||||||
clip: true
|
clip: true
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
id: contentLayout
|
id: contentLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 30
|
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 {
|
ListView {
|
||||||
id: schemeList
|
id: schemeList
|
||||||
spacing: 5
|
spacing: 5
|
||||||
|
|
@ -72,10 +91,6 @@ Rectangle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StyledText {
|
|
||||||
id: currentScheme
|
|
||||||
text: Config.cfg.appearance.currentTheme
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ Variants {
|
||||||
margins.left: Config.cfg.bar.floating ? 10 : 0
|
margins.left: Config.cfg.bar.floating ? 10 : 0
|
||||||
margins.right: Config.cfg.bar.floating ? 10 : 0
|
margins.right: Config.cfg.bar.floating ? 10 : 0
|
||||||
Rectangle {
|
Rectangle {
|
||||||
color: Colors.c.base00
|
color: Colors.c.base01
|
||||||
radius: Config.cfg.bar.floating ? Config.cfg.appearance.rounding : 0
|
radius: Config.cfg.bar.floating ? Config.cfg.appearance.rounding : 0
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"appearance": {
|
"appearance": {
|
||||||
"accent": "base0D",
|
"accent": "base0D",
|
||||||
"currentTheme": "base16-gruvbox-dark.json",
|
"currentTheme": "base16-rose-pine.json",
|
||||||
"font": "Inter",
|
"font": "Inter",
|
||||||
"fontSize": 14,
|
"fontSize": 14,
|
||||||
"iconSize": 16,
|
"iconSize": 16,
|
||||||
|
|
@ -14,6 +14,6 @@
|
||||||
},
|
},
|
||||||
"wallpaper": {
|
"wallpaper": {
|
||||||
"wallDir": "/home/lucy/.walls/",
|
"wallDir": "/home/lucy/.walls/",
|
||||||
"wallpaper": "/home/lucy/.walls/lain_wallpaper.png"
|
"wallpaper": "/home/lucy/.walls/lain_room.png"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import qs.settings
|
||||||
Rectangle {
|
Rectangle {
|
||||||
property color accent: Colors.c.base02
|
property color accent: Colors.c.base02
|
||||||
property bool active: false
|
property bool active: false
|
||||||
color: active ? Colors.c.base02 : Colors.c.base01
|
color: active ? Colors.c.base03 : Colors.c.base02
|
||||||
implicitHeight: Config.cfg.bar.height - 8
|
implicitHeight: Config.cfg.bar.height - 8
|
||||||
radius: Config.cfg.appearance.rounding - 4
|
radius: Config.cfg.appearance.rounding - 4
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue