mirror of
https://github.com/kossLAN/dots.git
synced 2025-11-05 06:59:50 -05:00
progress save
This commit is contained in:
parent
e359e006c7
commit
41ccd5c460
9 changed files with 164 additions and 287 deletions
|
|
@ -2,7 +2,7 @@ import QtQuick
|
|||
import QtQuick.Layouts
|
||||
import Quickshell
|
||||
import "power"
|
||||
import "volume"
|
||||
// import "volume"
|
||||
import "systray" as SysTray
|
||||
import "popups" as Popup
|
||||
import "../widgets" as Widgets
|
||||
|
|
@ -72,14 +72,14 @@ PanelWindow {
|
|||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
VolumeIndicator {
|
||||
id: volumeIndicator
|
||||
popup: root.popup
|
||||
Layout.preferredWidth: this.height
|
||||
Layout.fillHeight: true
|
||||
Layout.topMargin: 2
|
||||
Layout.bottomMargin: 2
|
||||
}
|
||||
// VolumeIndicator {
|
||||
// id: volumeIndicator
|
||||
// popup: root.popup
|
||||
// Layout.preferredWidth: this.height
|
||||
// Layout.fillHeight: true
|
||||
// Layout.topMargin: 2
|
||||
// Layout.bottomMargin: 2
|
||||
// }
|
||||
|
||||
BatteryIndicator {
|
||||
id: batteryIndicator
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Quickshell.Widgets
|
||||
|
|
@ -17,7 +16,7 @@ Item {
|
|||
|
||||
required property var popup
|
||||
|
||||
Widgets.MaterialButton {
|
||||
Widgets.StyledMouseArea {
|
||||
id: batteryButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ RowLayout {
|
|||
Layout.fillHeight: true
|
||||
required property SystemTrayItem modelData
|
||||
|
||||
Widgets.MaterialButton {
|
||||
Widgets.StyledMouseArea {
|
||||
id: trayButton
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
|
|
|
|||
|
|
@ -3,11 +3,9 @@ pragma ComponentBehavior: Bound
|
|||
|
||||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import Quickshell.Widgets
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Qt.labs.folderlistmodel
|
||||
import "../widgets/" as Widgets
|
||||
import "../"
|
||||
|
||||
Singleton {
|
||||
|
|
@ -63,242 +61,25 @@ Singleton {
|
|||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: container
|
||||
spacing: 5
|
||||
spacing: 20
|
||||
anchors.fill: parent
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 10
|
||||
}
|
||||
|
||||
ClippingRectangle {
|
||||
radius: 20
|
||||
Layout.preferredWidth: 464
|
||||
Layout.preferredHeight: 261
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.margins: 20
|
||||
|
||||
Image {
|
||||
id: wallpaperImage
|
||||
source: ShellSettings.settings.wallpaperUrl
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: ShellSettings.colors["surface_container"]
|
||||
radius: 20
|
||||
StackLayout {
|
||||
id: page
|
||||
currentIndex: topBar.currentIndex
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.preferredHeight: currentItem ? currentItem.implicitHeight : 0
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
readonly property Item currentItem: children[currentIndex]
|
||||
|
||||
ListView {
|
||||
id: horizontalList
|
||||
orientation: ListView.Horizontal
|
||||
model: ["scheme-content", "scheme-expressive", "scheme-fidelity", "scheme-fruit-salad", "scheme-monochrome", "scheme-neutral", "scheme-rainbow", "scheme-tonal-spot", "scheme-vibrant"]
|
||||
spacing: 10
|
||||
clip: true
|
||||
WallpaperPicker {}
|
||||
}
|
||||
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 100
|
||||
Layout.margins: 10
|
||||
|
||||
delegate: Rectangle {
|
||||
id: paletteCell
|
||||
required property string modelData
|
||||
property string matugenConf: Qt.resolvedUrl("root:wallpaper/matugen.toml").toString().replace("file://", "")
|
||||
property var colors: {
|
||||
"primary": "white",
|
||||
"secondary": "gray",
|
||||
"tertiary": "lightgrey",
|
||||
"container": "black"
|
||||
}
|
||||
|
||||
width: 100
|
||||
height: 100
|
||||
color: paletteSelect.containsMouse ? ShellSettings.colors["surface_container_highest"] : ShellSettings.colors["surface_container_high"]
|
||||
radius: 20
|
||||
|
||||
MouseArea {
|
||||
id: paletteSelect
|
||||
hoverEnabled: true
|
||||
anchors.fill: parent
|
||||
onPressed: {
|
||||
ShellSettings.settings.colorScheme = paletteCell.modelData;
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
id: paletteContainer
|
||||
width: 80
|
||||
height: 80
|
||||
anchors.centerIn: parent
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: OpacityMask {
|
||||
maskSource: Rectangle {
|
||||
width: paletteContainer.width
|
||||
height: paletteContainer.height
|
||||
radius: 20
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: topLeft
|
||||
color: paletteCell.colors["primary"] ?? "white"
|
||||
width: parent.width / 2
|
||||
height: parent.height / 2
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: topRight
|
||||
color: paletteCell.colors["secondary"] ?? "gray"
|
||||
width: parent.width / 2
|
||||
height: parent.height / 2
|
||||
anchors.left: topLeft.right
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: bottomLeft
|
||||
color: paletteCell.colors["tertiary"] ?? "lightgrey"
|
||||
width: parent.width / 2
|
||||
height: parent.height / 2
|
||||
anchors.top: topLeft.bottom
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: bottomRight
|
||||
color: paletteCell.colors["surface"] ?? "black"
|
||||
width: parent.width / 2
|
||||
height: parent.height / 2
|
||||
anchors {
|
||||
top: topRight.bottom
|
||||
left: bottomLeft.right
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: ShellSettings.settings
|
||||
function onWallpaperUrlChanged() {
|
||||
matugen.running = true;
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: matugen
|
||||
running: true
|
||||
command: ["matugen", "image", ShellSettings.settings.wallpaperUrl.replace("file://", ""), "--type", paletteCell.modelData, "--json", "hex", "--config", paletteCell.matugenConf, "--dry-run"]
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
try {
|
||||
paletteCell.colors = JSON.parse(data)['colors']['dark'];
|
||||
} catch (e) {
|
||||
console.error("Error parsing JSON:", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
stderr: SplitParser {
|
||||
onRead: data => console.log(`line read: ${data}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: ShellSettings.colors["surface_container_high"]
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
}
|
||||
|
||||
GridView {
|
||||
id: wallpaperGrid
|
||||
cellWidth: 200
|
||||
cellHeight: 200
|
||||
clip: true
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: 10
|
||||
|
||||
model: FolderListModel {
|
||||
id: folderModel
|
||||
folder: Qt.resolvedUrl("root:resources/wallpapers")
|
||||
nameFilters: ["*.jpg", "*.png"]
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
id: cell
|
||||
required property var modelData
|
||||
width: 200
|
||||
height: 200
|
||||
color: "transparent"
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
id: border
|
||||
visible: mouseArea.containsMouse
|
||||
color: "transparent"
|
||||
radius: 20
|
||||
|
||||
border {
|
||||
color: ShellSettings.colors["primary"]
|
||||
width: 2
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 1
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image
|
||||
source: cell.modelData.fileUrl
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
|
||||
sourceSize {
|
||||
height: image.height
|
||||
width: image.width
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 5
|
||||
}
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: OpacityMask {
|
||||
maskSource: Rectangle {
|
||||
width: cell.width
|
||||
height: cell.height
|
||||
radius: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
ShellSettings.settings.wallpaperUrl = cell.modelData.fileUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Widgets.TopBar {
|
||||
id: topBar
|
||||
model: ["headphones", "tune"]
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 35
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
135
shell/settings/WallpaperPicker.qml
Normal file
135
shell/settings/WallpaperPicker.qml
Normal file
|
|
@ -0,0 +1,135 @@
|
|||
pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Quickshell.Widgets
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import Qt.labs.folderlistmodel
|
||||
import ".."
|
||||
|
||||
ColumnLayout {
|
||||
id: container
|
||||
spacing: 5
|
||||
|
||||
|
||||
|
||||
// anchors {
|
||||
// fill: parent
|
||||
// margins: 10
|
||||
// }
|
||||
|
||||
ClippingRectangle {
|
||||
radius: 20
|
||||
Layout.preferredWidth: 464
|
||||
Layout.preferredHeight: 261
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.margins: 20
|
||||
|
||||
Image {
|
||||
id: wallpaperImage
|
||||
source: ShellSettings.settings.wallpaperUrl
|
||||
fillMode: Image.PreserveAspectFit
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
color: ShellSettings.colors["surface_container"]
|
||||
radius: 20
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
color: ShellSettings.colors["surface_container_high"]
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: 1
|
||||
}
|
||||
|
||||
GridView {
|
||||
id: wallpaperGrid
|
||||
cellWidth: 200
|
||||
cellHeight: 200
|
||||
clip: true
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
Layout.margins: 10
|
||||
|
||||
model: FolderListModel {
|
||||
id: folderModel
|
||||
folder: Qt.resolvedUrl("root:resources/wallpapers")
|
||||
nameFilters: ["*.jpg", "*.png"]
|
||||
}
|
||||
|
||||
delegate: Rectangle {
|
||||
id: cell
|
||||
required property var modelData
|
||||
width: 200
|
||||
height: 200
|
||||
color: "transparent"
|
||||
|
||||
Item {
|
||||
anchors.fill: parent
|
||||
|
||||
Rectangle {
|
||||
id: border
|
||||
visible: mouseArea.containsMouse
|
||||
color: "transparent"
|
||||
radius: 20
|
||||
|
||||
border {
|
||||
color: ShellSettings.colors["primary"]
|
||||
width: 2
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 1
|
||||
}
|
||||
}
|
||||
|
||||
Image {
|
||||
id: image
|
||||
source: cell.modelData.fileUrl
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
asynchronous: true
|
||||
|
||||
sourceSize {
|
||||
height: image.height
|
||||
width: image.width
|
||||
}
|
||||
|
||||
anchors {
|
||||
fill: parent
|
||||
margins: 5
|
||||
}
|
||||
|
||||
layer.enabled: true
|
||||
layer.effect: OpacityMask {
|
||||
maskSource: Rectangle {
|
||||
width: cell.width
|
||||
height: cell.height
|
||||
radius: 20
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: {
|
||||
ShellSettings.settings.wallpaperUrl = cell.modelData.fileUrl;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1,11 +1,9 @@
|
|||
import Quickshell
|
||||
import Quickshell.Io
|
||||
import QtQuick
|
||||
import ".."
|
||||
|
||||
Scope {
|
||||
id: root
|
||||
property string matugenConf: Qt.resolvedUrl("matugen.toml").toString().replace("file://", "")
|
||||
|
||||
LazyLoader {
|
||||
loading: true
|
||||
|
|
@ -40,43 +38,6 @@ Scope {
|
|||
|
||||
function onWallpaperUrlChanged() {
|
||||
console.log("Switching wallpaper: " + ShellSettings.settings.wallpaperUrl);
|
||||
matugen.running = true;
|
||||
}
|
||||
|
||||
function onColorSchemeChanged() {
|
||||
console.log("Switching color scheme: " + ShellSettings.settings.colorScheme);
|
||||
matugen.running = true;
|
||||
}
|
||||
}
|
||||
|
||||
Process {
|
||||
id: matugen
|
||||
running: false
|
||||
|
||||
// Don't format this lol
|
||||
command: [
|
||||
"matugen",
|
||||
"image",
|
||||
ShellSettings.settings.wallpaperUrl.replace("file://", ""),
|
||||
"--type",
|
||||
ShellSettings.settings.colorScheme,
|
||||
"--json",
|
||||
"hex",
|
||||
"--config",
|
||||
root.matugenConf
|
||||
]
|
||||
|
||||
stdout: SplitParser {
|
||||
onRead: data => {
|
||||
console.log(ShellSettings.settings.colorScheme);
|
||||
try {
|
||||
ShellSettings.colors = JSON.parse(data)['colors']['dark'];
|
||||
} catch (e) {}
|
||||
}
|
||||
}
|
||||
|
||||
stderr: SplitParser {
|
||||
onRead: data => console.log(`line read: ${data}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
import QtQuick
|
||||
import Quickshell.Widgets
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import ".."
|
||||
|
||||
Item {
|
||||
|
|
|
|||
|
|
@ -29,10 +29,11 @@ Item {
|
|||
property bool checked: index === root.currentIndex
|
||||
|
||||
onClicked: {
|
||||
currentIndex = index;
|
||||
currentIndex = button.index;
|
||||
root.updateSelectionBarPosition();
|
||||
}
|
||||
|
||||
// Change to SVG Icon
|
||||
FontIcon {
|
||||
text: button.modelData
|
||||
fill: {
|
||||
|
|
@ -79,6 +80,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
// Change to icons being greyed out by default but selected is full white
|
||||
function updateSelectionBarPosition() {
|
||||
if (buttonRepeater.count > 0) {
|
||||
var buttonWidth = buttonGroup.width / buttonRepeater.count;
|
||||
Loading…
Add table
Add a link
Reference in a new issue