add primitive shit for theme switching
This commit is contained in:
parent
09932291d2
commit
143889683b
6 changed files with 111 additions and 20 deletions
32
Colors.js
32
Colors.js
|
|
@ -1,18 +1,18 @@
|
||||||
const colors = {
|
const colors = {
|
||||||
base00: "#161616",
|
base00: "#1f2430",
|
||||||
base01: "#262626",
|
base01: "#242936",
|
||||||
base02: "#393939",
|
base02: "#323844",
|
||||||
base03: "#525252",
|
base03: "#4a5059",
|
||||||
base04: "#dde1e6",
|
base04: "#707a8c",
|
||||||
base05: "#f2f4f8",
|
base05: "#cccac2",
|
||||||
base06: "#ffffff",
|
base06: "#d9d7ce",
|
||||||
base07: "#08bdba",
|
base07: "#f3f4f5",
|
||||||
base08: "#ee5396",
|
base08: "#f28779",
|
||||||
base09: "#ff7eb6",
|
base09: "#ffad66",
|
||||||
base0A: "#ff6f00",
|
base0A: "#ffd173",
|
||||||
base0B: "#42be65",
|
base0B: "#d5ff80",
|
||||||
base0C: "#3ddbd9",
|
base0C: "#95e6cb",
|
||||||
base0D: "#33b1ff",
|
base0D: "#73d0ff",
|
||||||
base0E: "#be95ff",
|
base0E: "#d4bfff",
|
||||||
base0F: "#82cfff",
|
base0F: "#f27983",
|
||||||
}
|
}
|
||||||
|
|
|
||||||
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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -42,6 +42,9 @@ Variants {
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
Date {}
|
Date {}
|
||||||
|
ColorPickerButton {
|
||||||
|
barScreen: root.modelData
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.rightMargin: 10
|
anchors.rightMargin: 10
|
||||||
|
|
|
||||||
21
modules/bar/ColorPickerButton.qml
Normal file
21
modules/bar/ColorPickerButton.qml
Normal file
|
|
@ -0,0 +1,21 @@
|
||||||
|
import qs
|
||||||
|
import qs.widgets
|
||||||
|
import QtQuick
|
||||||
|
import Quickshell
|
||||||
|
import qs.modules.Services
|
||||||
|
|
||||||
|
BarComponent {
|
||||||
|
implicitWidth: text.width
|
||||||
|
required property ShellScreen barScreen
|
||||||
|
StyledText {
|
||||||
|
id: text
|
||||||
|
text: "temp!!!"
|
||||||
|
}
|
||||||
|
MouseArea {
|
||||||
|
id: clickHandler
|
||||||
|
acceptedButtons: Qt.LeftButton
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
anchors.fill: parent
|
||||||
|
onClicked: { WidgetTracker.toggle("colorschemes", parent.barScreen) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,12 +1,18 @@
|
||||||
import Quickshell
|
import Quickshell
|
||||||
import Quickshell.Io
|
import Quickshell.Io
|
||||||
|
import qs.modules.Services
|
||||||
|
|
||||||
|
|
||||||
IpcHandler {
|
IpcHandler {
|
||||||
id: handler
|
id: handler
|
||||||
target: "config"
|
target: "config"
|
||||||
function reload() {
|
function reload() {
|
||||||
Quickshell.reload(true)
|
Quickshell.reload(true);
|
||||||
|
}
|
||||||
|
function openPicker() {
|
||||||
|
WidgetTracker.toggle("colorschemes", null)
|
||||||
|
console.log(WidgetTracker.current)
|
||||||
|
}
|
||||||
|
function closeWidgets() {
|
||||||
|
WidgetTracker.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -114,11 +114,24 @@ Variants {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ThemeSwitcher {
|
||||||
|
z: 1
|
||||||
|
id: colorschemes
|
||||||
|
property bool shown: WidgetTracker.current === "colorschemes" && root.shown
|
||||||
|
visible: shown
|
||||||
|
focus: shown
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.topMargin: Config.cfg.bar.floating ? Config.cfg.bar.height + 20 : Config.cfg.bar.height + 10
|
||||||
|
anchors.margins: 20
|
||||||
|
implicitHeight: 60
|
||||||
|
}
|
||||||
MouseArea {
|
MouseArea {
|
||||||
id: dismisser
|
id: dismisser
|
||||||
z: 0
|
z: 0
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
acceptedButtons: Qt.LeftButton
|
acceptedButtons: Qt.AllButtons
|
||||||
onClicked: WidgetTracker.close()
|
onClicked: WidgetTracker.close()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue