This commit is contained in:
2026-02-26 23:36:29 -08:00
parent 3ed2df2cd5
commit 80efc104ed
5 changed files with 93 additions and 26 deletions

View File

@@ -7,9 +7,10 @@ Column {
top: parent.top top: parent.top
horizontalCenter: parent.horizontalCenter horizontalCenter: parent.horizontalCenter
} }
width: childrenRect.width width: Math.max(childrenRect.width, 300)
height: childrenRect.height height: childrenRect.height
anchors.topMargin: 6 anchors.topMargin: 6
TapHandler {onTapped: console.log(width)}
Rectangle { Rectangle {
radius: 12 radius: 12
height: 40 height: 40
@@ -19,11 +20,11 @@ Column {
color: "#181818" color: "#181818"
Rectangle { Rectangle {
color: "white" color: "white"
width: parent.width/3 - anchors.margins width: (parent.width - anchors.margins * 2)/3
anchors.top: parent.top anchors.top: parent.top
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
anchors.margins: 4 anchors.margins: 4
x: PowerProfiles.profile * (width + anchors.margins) + anchors.margins x: PowerProfiles.profile * width + anchors.margins
Behavior on x {NumberAnimation {duration: 300; easing.type: Easing.OutQuint}} Behavior on x {NumberAnimation {duration: 300; easing.type: Easing.OutQuint}}
radius: 8 radius: 8
} }
@@ -32,6 +33,7 @@ Column {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.margins: 4
component Profile: Rectangle { component Profile: Rectangle {
id: profile id: profile
color: "transparent" color: "transparent"

View File

@@ -51,9 +51,6 @@ Item {
cursorDelegate: Item {} cursorDelegate: Item {}
onCursorPositionChanged: cursorPosition = text.length onCursorPositionChanged: cursorPosition = text.length
Keys.onPressed: (event) => { switch (event.key) { Keys.onPressed: (event) => { switch (event.key) {
case Qt.Key_Escape:
background.index = 0;
break;
case Qt.Key_Return: case Qt.Key_Return:
list.currentItem.execute(); list.currentItem.execute();
root.close(); root.close();

View File

@@ -1,4 +1,5 @@
import QtQuick import QtQuick
import QtQuick.Shapes
import Quickshell import Quickshell
import Quickshell.Widgets import Quickshell.Widgets
import Quickshell.Services.Mpris import Quickshell.Services.Mpris
@@ -42,17 +43,33 @@ Item {
} }
ListView { ListView {
anchors.fill: parent anchors.fill: parent
anchors.leftMargin: 4
anchors.rightMargin: anchors.leftMargin
clip: true clip: true
spacing: 4 spacing: 4
interactive: background.index === 3
add: Transition {NumberAnimation {
property: "opacity"
from: 0
to: 1
duration: 150
}}
remove: Transition {NumberAnimation {
property: "opacity"
from: 1
to: 0
duration: 150
}}
displaced: Transition {NumberAnimation {
property: "y"
duration: 300
}}
header: Item {height: 4; width: 1} header: Item {height: 4; width: 1}
model: Array.from(notifServer.trackedNotifications.values) model: Array.from(notifServer.trackedNotifications.values)
delegate: Widgets.Notification { delegate: Widgets.Notification {
color: "#222" color: "#222"
anchors {
left: parent.left
right: parent.right
margins: 4
}
} }
} }
} }
@@ -64,6 +81,8 @@ Item {
Column { Column {
anchors.centerIn: parent anchors.centerIn: parent
spacing: 2 spacing: 2
opacity: !Mpris.players.values.length
Behavior on opacity {NumberAnimation {duration: 150}}
Image { Image {
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
source: Quickshell.shellPath("assets/player-symbolic.svg") source: Quickshell.shellPath("assets/player-symbolic.svg")
@@ -81,12 +100,47 @@ Item {
Column { Column {
anchors.centerIn: parent anchors.centerIn: parent
opacity: Mpris.players.values.length opacity: Mpris.players.values.length
ClippingRectangle { Behavior on opacity {NumberAnimation {duration: 150}}
color: "transparent" Shape {
anchors.horizontalCenter: parent.horizontalCenter
width: 180 width: 180
height: 180 height: 180
preferredRendererType: Shape.CurveRenderer
ShapePath {
capStyle: ShapePath.RoundCap
strokeColor: "#444"
fillColor: "transparent"
strokeWidth: 4
PathAngleArc {
moveToStart: true
radiusX: 90 - 6
radiusY: 90 - 6
centerX: 90
centerY: 90
startAngle: 90 + 20
sweepAngle: 360 - 40
}
}
ShapePath {
capStyle: ShapePath.RoundCap
strokeColor: "white"
fillColor: "transparent"
strokeWidth: 4
PathAngleArc {
moveToStart: true
radiusX: 90 - 6
radiusY: 90 - 6
centerX: 90
centerY: 90
startAngle: 90 + 20
sweepAngle: (player.modelData?.position/player.modelData.length) * (360 - 40)
}
}
ClippingRectangle {
color: "transparent"
radius: height/2 radius: height/2
anchors.horizontalCenter: parent.horizontalCenter anchors.fill: parent
anchors.margins: 12
Image { Image {
anchors.fill: parent anchors.fill: parent
source: player.modelData?.trackArtUrl ?? source source: player.modelData?.trackArtUrl ?? source
@@ -94,11 +148,14 @@ Item {
NumberAnimation on rotation { NumberAnimation on rotation {
id: spin id: spin
paused: !player.modelData?.isPlaying || !root.up || background.index !== 3 paused: !player.modelData?.isPlaying || !root.up || background.index !== 3
duration: 30000 duration: 60000
loops: Animation.Infinite loops: Animation.Infinite
from: 0 from: 0
to: 360 to: 360
} }
layer.enabled: true
layer.smooth: true
}
} }
Item {width: 1; height: 10} Item {width: 1; height: 10}
Text { Text {
@@ -147,6 +204,10 @@ Item {
clicked: player.modelData?.next clicked: player.modelData?.next
} }
} }
FrameAnimation {
running: background.index === 3
onTriggered: player.modelData.positionChanged()
}
} }
} }
} }

View File

@@ -17,6 +17,7 @@ Item {
background.index = 4 background.index = 4
notifPopup.modelData = notif notifPopup.modelData = notif
root.open() root.open()
timeout.restart()
} }
} }
Widgets.Notification { Widgets.Notification {
@@ -25,4 +26,10 @@ Item {
modelData: notifServer.trackedNotifications.values[0] ?? undefined modelData: notifServer.trackedNotifications.values[0] ?? undefined
color: "transparent" color: "transparent"
} }
Timer {
id: timeout
running: false
interval: 3000
onTriggered: root.close()
}
} }

View File

@@ -46,7 +46,7 @@ Item {
} }
} }
Text { Text {
id: content visible: UPower.displayDevice.type === UPowerDeviceType.Battery
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
x: 10 x: 10
color: "white" color: "white"