This commit is contained in:
lucy 2026-01-23 16:35:22 +01:00
commit 3525dcd2f1
3 changed files with 59 additions and 39 deletions

View File

@ -35,22 +35,22 @@ Loader {
return "battery_android_frame_bolt"; return "battery_android_frame_bolt";
} }
if (frame1) { if (frame1) {
return "battery_1_bar"; return "battery_android_frame_1";
} }
if (frame2) { if (frame2) {
return "battery_2_bar"; return "battery_android_frame_2";
} }
if (frame3) { if (frame3) {
return "battery_3_bar"; return "battery_android_frame_3";
} }
if (frame4) { if (frame4) {
return "battery_4_bar"; return "battery_android_frame_4";
} }
if (frame5) { if (frame5) {
return "battery_5_bar"; return "battery_android_frame_5";
} }
if (frame6) { if (frame6) {
return "battery_full"; return "battery_android_frame_full";
} }
} }
function getProfileIcon() { function getProfileIcon() {
@ -74,10 +74,12 @@ Loader {
spacing: 5 spacing: 5
CustomText { CustomText {
id: batText id: batText
anchors.verticalCenter: parent.verticalCenter
text: Math.round(UPower.displayDevice.percentage * 100) + "%" text: Math.round(UPower.displayDevice.percentage * 100) + "%"
} }
CustomIcon { CustomIcon {
id: batIcon id: batIcon
font.family: "Material Symbols Rounded"
text: root.getBatteryIcon() text: root.getBatteryIcon()
} }
Item { Item {
@ -95,7 +97,7 @@ Loader {
ColorOverlay { ColorOverlay {
anchors.fill: parent anchors.fill: parent
source: rawProfileIcon source: rawProfileIcon
color: Colors.foreground color: Colors.onSurfaceColor
} }
} }
} }

View File

@ -8,14 +8,18 @@ import Qt.labs.folderlistmodel 2.10
import Quickshell.Io import Quickshell.Io
import qs import qs
import Quickshell.Hyprland import Quickshell.Hyprland
import QtQuick.Layouts
FloatingWindow { FloatingWindow {
id: root id: root
implicitHeight: 600
implicitWidth: 900
title: "qs-wallswitcher"
visible: Settings.config.wallSwitcherShown visible: Settings.config.wallSwitcherShown
color: Colors.background
onClosed: { onClosed: {
Settings.config.wallSwitcherShown = false; Settings.config.wallSwitcherShown = false;
} }
Process { Process {
id: wallustRunner id: wallustRunner
property string cmd: "matugen image " + Settings.config.currentWall property string cmd: "matugen image " + Settings.config.currentWall
@ -28,31 +32,55 @@ FloatingWindow {
} }
} }
implicitHeight: 600 ColumnLayout {
implicitWidth: 900 id: windowLayout
title: "qs-wallswitcher" spacing: 10
color: Colors.background
WrapperItem {
id: innerWindowWrapper
anchors.centerIn: parent
anchors.fill: parent anchors.fill: parent
margin: 20
child: Rectangle { Rectangle {
id: textWrapper
Layout.fillWidth: true
Layout.margins: 10
Layout.alignment: Qt.AlignCenter
Layout.bottomMargin: 0
radius: 14
implicitHeight: 30
color: Colors.color6
CustomText {
id: titleText
anchors.centerIn: textWrapper
text: "Wallpapers in " + Settings.config.wallDir
}
}
Rectangle {
id: innerWindow id: innerWindow
anchors.fill: parent Layout.topMargin: 0
anchors.centerIn: parent Layout.fillWidth: true
implicitWidth: parent.implicitWidth Layout.fillHeight: true
implicitHeight: parent.implicitHeight Layout.margins: 10
radius: 14
color: Colors.color8
GridView { GridView {
id: gridRoot 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 cellWidth: 140
cellHeight: 100 cellHeight: 100
topMargin: innerWindowText.implicitHeight + innerWindowText.topPadding anchors.fill: innerWindow
anchors.fill: parent anchors.centerIn: innerWindow
anchors.horizontalCenter: parent.horizontalCenter leftMargin: emptySpace / 2
leftMargin: 40 rightMargin: emptySpace / 2
rightMargin: 20 anchors.margins: 20
model: folderModel
delegate: fileDelegate
FolderListModel { FolderListModel {
id: folderModel id: folderModel
folder: Settings.config.wallDir folder: Settings.config.wallDir
@ -84,18 +112,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