add primitive shit for theme switching
This commit is contained in:
parent
09932291d2
commit
143889683b
6 changed files with 111 additions and 20 deletions
48
modules/applets/ThemeSwitcher.qml
Normal file
48
modules/applets/ThemeSwitcher.qml
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Wayland
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
|
||||
import qs
|
||||
import qs.settings
|
||||
import qs.widgets
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.AllButtons
|
||||
}
|
||||
clip: true
|
||||
color: Colors.base00
|
||||
Process {
|
||||
id: getSchemes
|
||||
property list<string> schemes
|
||||
running: true
|
||||
command: ["tinty", "list"]
|
||||
stdout: SplitParser {
|
||||
onRead: text => {
|
||||
getSchemes.schemes.push(text);
|
||||
}
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: schemeList
|
||||
orientation: ListView.Horizontal
|
||||
anchors.fill: root
|
||||
model: getSchemes.schemes
|
||||
delegate: Rectangle {
|
||||
id: container
|
||||
required property string modelData
|
||||
color: Colors.base01
|
||||
height: 30
|
||||
implicitWidth: schemeName.width + 16
|
||||
StyledText {
|
||||
id: schemeName
|
||||
text: container.modelData
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue