feat: clamshell lock pfp
This commit is contained in:
parent
84a82a9e78
commit
cea090da31
2 changed files with 31 additions and 9 deletions
|
|
@ -16,7 +16,7 @@ ColumnLayout {
|
||||||
Layout.fillWidth: false
|
Layout.fillWidth: false
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
|
|
||||||
spacing: Tokens.spacing.largeIncreased * 2
|
spacing: Tokens.spacing.largeIncreased
|
||||||
|
|
||||||
Clock {
|
Clock {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
@ -25,7 +25,6 @@ ColumnLayout {
|
||||||
|
|
||||||
StyledText {
|
StyledText {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
Layout.topMargin: -Tokens.padding.largeIncreased
|
|
||||||
|
|
||||||
text: Time.format("dddd • d MMM").toUpperCase()
|
text: Time.format("dddd • d MMM").toUpperCase()
|
||||||
color: Colours.palette.m3onSurface
|
color: Colours.palette.m3onSurface
|
||||||
|
|
@ -34,6 +33,8 @@ ColumnLayout {
|
||||||
|
|
||||||
ProfilePic {
|
ProfilePic {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
Layout.topMargin: Tokens.spacing.largeIncreased
|
||||||
|
Layout.bottomMargin: Tokens.spacing.medium
|
||||||
centerWidth: root.centerWidth
|
centerWidth: root.centerWidth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -45,7 +46,6 @@ ColumnLayout {
|
||||||
|
|
||||||
StateMessage {
|
StateMessage {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: -Tokens.spacing.largeIncreased
|
|
||||||
pam: root.lock.pam
|
pam: root.lock.pam
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,20 +1,37 @@
|
||||||
|
pragma ComponentBehavior: Bound
|
||||||
|
|
||||||
import QtQuick
|
import QtQuick
|
||||||
|
import M3Shapes
|
||||||
import Caelestia.Config
|
import Caelestia.Config
|
||||||
import qs.components
|
import qs.components
|
||||||
|
import qs.components.effects
|
||||||
import qs.components.images
|
import qs.components.images
|
||||||
import qs.services
|
import qs.services
|
||||||
import qs.utils
|
import qs.utils
|
||||||
|
|
||||||
StyledClippingRect {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
required property int centerWidth
|
required property int centerWidth
|
||||||
|
readonly property color bgColour: Colours.tPalette.m3surfaceContainerHighest
|
||||||
|
|
||||||
implicitWidth: centerWidth / 2
|
implicitWidth: Math.round(centerWidth * 0.7)
|
||||||
implicitHeight: centerWidth / 2
|
implicitHeight: {
|
||||||
|
const bounds = shape.pathBounds();
|
||||||
|
return bounds.height - bounds.y;
|
||||||
|
}
|
||||||
|
|
||||||
color: Colours.tPalette.m3surfaceContainer
|
MaterialShape {
|
||||||
radius: Tokens.rounding.full
|
id: shape
|
||||||
|
|
||||||
|
anchors.centerIn: parent
|
||||||
|
implicitSize: root.implicitWidth
|
||||||
|
|
||||||
|
shape: MaterialShape.ClamShell
|
||||||
|
color: Qt.alpha(root.bgColour, 1)
|
||||||
|
opacity: root.bgColour.a
|
||||||
|
layer.enabled: true
|
||||||
|
}
|
||||||
|
|
||||||
MaterialIcon {
|
MaterialIcon {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
@ -28,7 +45,12 @@ StyledClippingRect {
|
||||||
CachingImage {
|
CachingImage {
|
||||||
id: pfp
|
id: pfp
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: shape
|
||||||
path: `${Paths.home}/.face`
|
path: `${Paths.home}/.face`
|
||||||
|
|
||||||
|
layer.enabled: true
|
||||||
|
layer.effect: Mask {
|
||||||
|
maskSource: shape
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue