style wallpaperswitcher

This commit is contained in:
lucy 2026-01-22 10:30:41 +01:00
parent 0e04538a7b
commit 520ca3bb4c
3 changed files with 47 additions and 32 deletions

View File

@ -74,6 +74,7 @@ Loader {
spacing: 5
CustomText {
id: batText
anchors.verticalCenter: parent.verticalCenter
text: Math.round(UPower.displayDevice.percentage * 100) + "%"
}
CustomIcon {

View File

@ -8,14 +8,18 @@ import Qt.labs.folderlistmodel 2.10
import Quickshell.Io
import qs
import Quickshell.Hyprland
import QtQuick.Layouts
FloatingWindow {
id: root
implicitHeight: 600
implicitWidth: 900
title: "qs-wallswitcher"
visible: Settings.config.wallSwitcherShown
color: Colors.background
onClosed: {
Settings.config.wallSwitcherShown = false;
}
Process {
id: wallustRunner
property string cmd: "matugen image " + Settings.config.currentWall
@ -28,31 +32,51 @@ FloatingWindow {
}
}
implicitHeight: 600
implicitWidth: 900
title: "qs-wallswitcher"
color: Colors.background
WrapperItem {
id: innerWindowWrapper
anchors.centerIn: parent
ColumnLayout {
id: windowLayout
anchors.fill: parent
margin: 20
child: Rectangle {
Rectangle {
id: textWrapper
Layout.fillWidth: true
Layout.margins: 20
Layout.alignment: Qt.AlignCenter
radius: 14
implicitHeight: 30
color: Colors.color6
CustomText {
id: titleText
anchors.centerIn: textWrapper
text: "Wallpapers in " + Settings.config.wallDir
}
}
Rectangle {
id: innerWindow
anchors.fill: parent
anchors.centerIn: parent
implicitWidth: parent.implicitWidth
implicitHeight: parent.implicitHeight
Layout.fillWidth: true
Layout.fillHeight: true
Layout.margins: 20
radius: 14
color: Colors.color8
GridView {
id: gridRoot
property var columns: Math.floor(gridRoot.width / cellWidth)
property var usedWidth: columns * cellWidth
property var emptySpace: width - usedWidth
property var rows: Math.floor(gridRoot.height / cellHeight)
property var usedHeight: rows * cellHeight
property var emptyHeight: height - usedHeight
clip: true
boundsBehavior: Flickable.StopAtBounds
snapMode: GridView.SnapToRow
cellWidth: 140
cellHeight: 100
topMargin: innerWindowText.implicitHeight + innerWindowText.topPadding
anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter
leftMargin: 40
rightMargin: 20
anchors.fill: innerWindow
anchors.centerIn: innerWindow
leftMargin: emptySpace / 2
anchors.margins: 20
model: folderModel
delegate: fileDelegate
FolderListModel {
id: folderModel
folder: Settings.config.wallDir
@ -84,18 +108,6 @@ FloatingWindow {
}
}
}
model: folderModel
delegate: fileDelegate
}
radius: 24
color: Colors.background
CustomText {
id: innerWindowText
topPadding: 10
text: "Wallpapers in " + Settings.config.wallDir
anchors.horizontalCenter: parent.horizontalCenter
}
}
}

View File

@ -0,0 +1,2 @@
import qs
import qs.settings