summaryrefslogtreecommitdiff
path: root/modules/lock
diff options
context:
space:
mode:
Diffstat (limited to 'modules/lock')
-rw-r--r--modules/lock/Center.qml5
-rw-r--r--modules/lock/Content.qml12
-rw-r--r--modules/lock/LockSurface.qml1
-rw-r--r--modules/lock/Media.qml95
4 files changed, 112 insertions, 1 deletions
diff --git a/modules/lock/Center.qml b/modules/lock/Center.qml
index b288284..3df61a0 100644
--- a/modules/lock/Center.qml
+++ b/modules/lock/Center.qml
@@ -48,7 +48,7 @@ ColumnLayout {
}
Loader {
- Layout.leftMargin: Appearance.spacing.normal
+ Layout.leftMargin: Appearance.spacing.small
Layout.alignment: Qt.AlignVCenter
asynchronous: true
@@ -118,6 +118,9 @@ ColumnLayout {
}
Keys.onPressed: event => {
+ if (!root.lock.locked)
+ return;
+
if (event.key === Qt.Key_Enter || event.key === Qt.Key_Return)
inputField.placeholder.animate = false;
diff --git a/modules/lock/Content.qml b/modules/lock/Content.qml
index b7d3ddb..176dc8e 100644
--- a/modules/lock/Content.qml
+++ b/modules/lock/Content.qml
@@ -36,9 +36,21 @@ RowLayout {
Layout.fillWidth: true
Layout.fillHeight: true
+ radius: Appearance.rounding.small
+ color: Colours.tPalette.m3surfaceContainer
+ }
+
+ StyledClippingRect {
+ Layout.fillWidth: true
+ implicitHeight: media.implicitHeight
+
bottomLeftRadius: Appearance.rounding.large
radius: Appearance.rounding.small
color: Colours.tPalette.m3surfaceContainer
+
+ Media {
+ id: media
+ }
}
}
diff --git a/modules/lock/LockSurface.qml b/modules/lock/LockSurface.qml
index 3fe44d3..a512070 100644
--- a/modules/lock/LockSurface.qml
+++ b/modules/lock/LockSurface.qml
@@ -62,6 +62,7 @@ WlSessionLockSurface {
target: lockIcon
property: "opacity"
to: 1
+ duration: Appearance.anim.durations.large
}
Anim {
target: background
diff --git a/modules/lock/Media.qml b/modules/lock/Media.qml
new file mode 100644
index 0000000..055ed62
--- /dev/null
+++ b/modules/lock/Media.qml
@@ -0,0 +1,95 @@
+pragma ComponentBehavior: Bound
+
+import qs.components
+import qs.services
+import qs.config
+import Quickshell
+import QtQuick
+import QtQuick.Layouts
+
+Item {
+ id: root
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ implicitHeight: layout.implicitHeight
+
+ Image {
+ anchors.fill: parent
+ source: Players.active?.trackArtUrl ?? null
+
+ asynchronous: true
+ fillMode: Image.PreserveAspectCrop
+ sourceSize.width: width
+ sourceSize.height: height
+
+ layer.enabled: true
+ layer.effect: ShaderEffect {
+ required property Item source
+ readonly property Item maskSource: mask
+
+ fragmentShader: `file://${Quickshell.shellDir}/assets/shaders/opacitymask.frag.qsb`
+ }
+ }
+
+ Rectangle {
+ id: mask
+
+ anchors.fill: parent
+ layer.enabled: true
+ visible: false
+
+ gradient: Gradient {
+ orientation: Gradient.Horizontal
+
+ GradientStop {
+ position: 0
+ color: Qt.rgba(0, 0, 0, 0.5)
+ }
+ GradientStop {
+ position: 0.4
+ color: Qt.rgba(0, 0, 0, 0.2)
+ }
+ GradientStop {
+ position: 0.8
+ color: Qt.rgba(0, 0, 0, 0)
+ }
+ }
+ }
+
+ ColumnLayout {
+ id: layout
+
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.margins: Appearance.padding.large
+
+ StyledText {
+ Layout.topMargin: Appearance.padding.large
+ text: qsTr("Now playing")
+ color: Colours.palette.m3outline
+ }
+
+ StyledText {
+ Layout.fillWidth: true
+ text: Players.active?.trackArtist ?? qsTr("No media")
+ color: Colours.palette.m3primary
+ horizontalAlignment: Text.AlignHCenter
+ font.pointSize: Appearance.font.size.large
+ font.weight: 500
+ elide: Text.ElideRight
+ }
+
+ StyledText {
+ Layout.fillWidth: true
+ text: Players.active?.trackTitle ?? qsTr("No media")
+ horizontalAlignment: Text.AlignHCenter
+ elide: Text.ElideRight
+ }
+
+ RowLayout {
+ Layout.fillWidth: true
+ Layout.bottomMargin: Appearance.padding.large
+ }
+ }
+}