chore: misc

This commit is contained in:
Nydragon 2024-11-17 17:23:44 +01:00
parent f4fa7deadf
commit 9a87f66962
Signed by: nydragon
SSH key fingerprint: SHA256:WcjW5NJPQ8Dx4uQDmoIlVPLWE27Od3fxoe0IUvuoPHE
3 changed files with 13 additions and 12 deletions

View file

@ -13,6 +13,9 @@ ShellRoot {
} }
} }
LazyLoader {
id: loader
Component.onCompleted: { Component.onCompleted: {
Quickshell.reloadCompleted.connect(() => loader.active = false); Quickshell.reloadCompleted.connect(() => loader.active = false);
Quickshell.reloadFailed.connect(e => { Quickshell.reloadFailed.connect(e => {
@ -21,9 +24,6 @@ ShellRoot {
}); });
} }
LazyLoader {
id: loader
property string message: "" property string message: ""
PanelWindow { PanelWindow {

View file

@ -26,17 +26,19 @@ BRectangle {
orientation: Qt.Horizontal orientation: Qt.Horizontal
snapMode: ListView.SnapOneItem snapMode: ListView.SnapOneItem
spacing: 10 spacing: 10
delegate: Item { delegate: BRectangle {
id: card id: card
required property var modelData required property var modelData
property MprisPlayer player: modelData property MprisPlayer player: modelData
width: mprisSmall.width width: mprisSmall.width
height: mprisSmall.height height: mprisSmall.height
radius: 15
BlurredImage { BlurredImage {
source: card.player?.trackArtUrl ?? "" source: card.player?.trackArtUrl ?? ""
anchors.fill: parent anchors.fill: parent
radius: 15 radius: parent.radius
} }
RowLayout { RowLayout {
@ -104,7 +106,7 @@ BRectangle {
size: 20 size: 20
} }
BIconButton { BIconButton {
source: Quickshell.iconPath(card.player.playbackState === MprisPlaybackState.Playing ? "media-playback-pause" : "media-playback-start") source: Quickshell.iconPath(card.player?.playbackState === MprisPlaybackState.Playing ? "media-playback-pause" : "media-playback-start")
onClicked: card.player?.togglePlaying() onClicked: card.player?.togglePlaying()
size: 20 size: 20
} }

View file

@ -1,6 +1,5 @@
import QtQuick import QtQuick
import Quickshell import Quickshell
import Quickshell.Io
import Quickshell.Hyprland import Quickshell.Hyprland
import Quickshell.I3 import Quickshell.I3