diff options
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/dashboard/dash/User.qml | 64 |
1 files changed, 57 insertions, 7 deletions
diff --git a/modules/dashboard/dash/User.qml b/modules/dashboard/dash/User.qml index c7d2bfd..4aefb31 100644 --- a/modules/dashboard/dash/User.qml +++ b/modules/dashboard/dash/User.qml @@ -19,17 +19,67 @@ Row { radius: Appearance.rounding.full color: Colours.palette.m3surfaceContainerHigh - MaterialIcon { - anchors.centerIn: parent + CachingImage { + anchors.fill: parent + path: `${Paths.home}/.face` + fillMode: Image.PreserveAspectCrop + smooth: true + } - text: "person" - fill: 1 - font.pointSize: (info.implicitHeight / 2) || 1 + Rectangle { + id: overlay + anchors.fill: parent + radius: avatarRect.radius + color: Qt.rgba(0, 0, 0, 0.4) + opacity: mouseArea.containsMouse ? 1.0 : 0.0 + visible: opacity > 0 + Behavior on opacity { + NumberAnimation { + duration: 300 + easing.type: Easing.InOutQuad + } + } + + MaterialIcon { + anchors.centerIn: parent + text: "photo_camera" + color: "white" + font.pointSize: info.implicitHeight / 4 + } } - CachingImage { + MouseArea { + id: mouseArea anchors.fill: parent - path: `${Paths.home}/.face` + hoverEnabled: true + onClicked: avatarUpdateProc.running = true + cursorShape: Qt.PointingHandCursor + } + + Process { + id: avatarUpdateProc + running: false + command: [`${Paths.home}/.local/share/caelestia/shell/scripts/caelestia-avatar-picker.sh`] + + stdout: SplitParser { + onRead: { + notifyProc.running = true + } + } + } + + Process { + id: notifyProc + running: false + command: [ + "notify-send", + "-u", "low", + "-i", "dialog-information-symbolic", + "Profile Updated", + "Your avatar has been successfully changed.", + "-a", "Shell", + "-A", "OK=Got it!" + ] } } |