diff options
| -rw-r--r-- | modules/dashboard/Content.qml | 2 | ||||
| -rw-r--r-- | modules/dashboard/Dash.qml | 2 | ||||
| -rw-r--r-- | modules/dashboard/Wrapper.qml | 12 | ||||
| -rw-r--r-- | modules/dashboard/dash/User.qml | 88 |
4 files changed, 0 insertions, 104 deletions
diff --git a/modules/dashboard/Content.qml b/modules/dashboard/Content.qml index 7259c4f..70cfaf9 100644 --- a/modules/dashboard/Content.qml +++ b/modules/dashboard/Content.qml @@ -13,7 +13,6 @@ Item { required property PersistentProperties visibilities required property PersistentProperties state - required property FileDialog facePicker readonly property real nonAnimWidth: view.implicitWidth + viewWrapper.anchors.margins * 2 readonly property real nonAnimHeight: tabs.implicitHeight + tabs.anchors.topMargin + view.implicitHeight + viewWrapper.anchors.margins * 2 @@ -90,7 +89,6 @@ Item { sourceComponent: Dash { visibilities: root.visibilities state: root.state - facePicker: root.facePicker } } diff --git a/modules/dashboard/Dash.qml b/modules/dashboard/Dash.qml index 71e224f..0bc81b4 100644 --- a/modules/dashboard/Dash.qml +++ b/modules/dashboard/Dash.qml @@ -11,7 +11,6 @@ GridLayout { required property PersistentProperties visibilities required property PersistentProperties state - required property FileDialog facePicker rowSpacing: Appearance.spacing.normal columnSpacing: Appearance.spacing.normal @@ -29,7 +28,6 @@ GridLayout { visibilities: root.visibilities state: root.state - facePicker: root.facePicker } } diff --git a/modules/dashboard/Wrapper.qml b/modules/dashboard/Wrapper.qml index 0e37909..3f8f2bd 100644 --- a/modules/dashboard/Wrapper.qml +++ b/modules/dashboard/Wrapper.qml @@ -18,17 +18,6 @@ Item { reloadableId: "dashboardState" } - readonly property FileDialog facePicker: FileDialog { - title: qsTr("Select a profile picture") - filterLabel: qsTr("Image files") - filters: Images.validImageExtensions - onAccepted: path => { - if (CUtils.copyFile(Qt.resolvedUrl(path), Qt.resolvedUrl(`${Paths.home}/.face`))) - Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "low", "-h", `STRING:image-path:${path}`, "Profile picture changed", `Profile picture changed to ${Paths.shortenHome(path)}`]); - else - Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "critical", "Unable to change profile picture", `Failed to change profile picture to ${Paths.shortenHome(path)}`]); - } - } readonly property real nonAnimHeight: state === "visible" ? (content.item?.nonAnimHeight ?? 0) : 0 @@ -99,7 +88,6 @@ Item { sourceComponent: Content { visibilities: root.visibilities state: root.dashState - facePicker: root.facePicker } } } diff --git a/modules/dashboard/dash/User.qml b/modules/dashboard/dash/User.qml index b66b1f9..6cb06f2 100644 --- a/modules/dashboard/dash/User.qml +++ b/modules/dashboard/dash/User.qml @@ -13,98 +13,10 @@ Row { required property PersistentProperties visibilities required property PersistentProperties state - required property FileDialog facePicker padding: Appearance.padding.large spacing: Appearance.spacing.normal - StyledClippingRect { - implicitWidth: info.implicitHeight - implicitHeight: info.implicitHeight - - radius: Appearance.rounding.large - color: Colours.layer(Colours.palette.m3surfaceContainerHigh, 2) - - MaterialIcon { - anchors.centerIn: parent - - text: "person" - fill: 1 - grade: 200 - font.pointSize: Math.floor(info.implicitHeight / 2) || 1 - } - - CachingImage { - id: pfp - - anchors.fill: parent - path: `${Paths.home}/.face` - } - - MouseArea { - anchors.fill: parent - hoverEnabled: true - - StyledRect { - anchors.fill: parent - - color: Qt.alpha(Colours.palette.m3scrim, 0.5) - opacity: parent.containsMouse ? 1 : 0 - - Behavior on opacity { - Anim { - duration: Appearance.anim.durations.expressiveFastSpatial - } - } - } - - StyledRect { - anchors.centerIn: parent - - implicitWidth: selectIcon.implicitHeight + Appearance.padding.small * 2 - implicitHeight: selectIcon.implicitHeight + Appearance.padding.small * 2 - - radius: Appearance.rounding.normal - color: Colours.palette.m3primary - scale: parent.containsMouse ? 1 : 0.5 - opacity: parent.containsMouse ? 1 : 0 - - StateLayer { - color: Colours.palette.m3onPrimary - - function onClicked(): void { - root.visibilities.launcher = false; - root.facePicker.open(); - } - } - - MaterialIcon { - id: selectIcon - - anchors.centerIn: parent - anchors.horizontalCenterOffset: -font.pointSize * 0.02 - - text: "frame_person" - color: Colours.palette.m3onPrimary - font.pointSize: Appearance.font.size.extraLarge - } - - Behavior on scale { - Anim { - duration: Appearance.anim.durations.expressiveFastSpatial - easing.bezierCurve: Appearance.anim.curves.expressiveFastSpatial - } - } - - Behavior on opacity { - Anim { - duration: Appearance.anim.durations.expressiveFastSpatial - } - } - } - } - } - Column { id: info |