summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-20 16:14:15 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-20 16:14:15 +1000
commit3ecc0267fad3a1462d1316bc0147906376e9e85a (patch)
tree5765810770f12070a90aba7b60ce660f7cb75de2
parentfiledialog: loader (diff)
downloadcaelestia-shell-3ecc0267fad3a1462d1316bc0147906376e9e85a.tar.gz
caelestia-shell-3ecc0267fad3a1462d1316bc0147906376e9e85a.tar.bz2
caelestia-shell-3ecc0267fad3a1462d1316bc0147906376e9e85a.zip
feat: better file dialog
-rw-r--r--modules/background/Wallpaper.qml8
-rw-r--r--modules/dashboard/Wrapper.qml12
2 files changed, 10 insertions, 10 deletions
diff --git a/modules/background/Wallpaper.qml b/modules/background/Wallpaper.qml
index c5d99d1..57f5dc0 100644
--- a/modules/background/Wallpaper.qml
+++ b/modules/background/Wallpaper.qml
@@ -1,11 +1,11 @@
pragma ComponentBehavior: Bound
import qs.widgets
+import qs.widgets.filedialog
import qs.services
import qs.config
import qs.utils
import QtQuick
-import QtQuick.Dialogs
Item {
id: root
@@ -65,9 +65,9 @@ Item {
id: dialog
title: qsTr("Select a wallpaper")
- acceptLabel: qsTr("Select")
- nameFilters: [`Image files (${Wallpapers.extensions.map(e => `*.${e}`).join(" ")})`]
- onAccepted: Wallpapers.setWallpaper(Paths.strip(selectedFile))
+ filterLabel: qsTr("Image files")
+ filters: Wallpapers.extensions
+ onAccepted: path => Wallpapers.setWallpaper(path)
}
StateLayer {
diff --git a/modules/dashboard/Wrapper.qml b/modules/dashboard/Wrapper.qml
index 6a38bf4..d3630a6 100644
--- a/modules/dashboard/Wrapper.qml
+++ b/modules/dashboard/Wrapper.qml
@@ -1,11 +1,11 @@
pragma ComponentBehavior: Bound
+import qs.widgets.filedialog
import qs.services
import qs.config
import qs.utils
import Quickshell
import QtQuick
-import QtQuick.Dialogs
Item {
id: root
@@ -16,11 +16,11 @@ Item {
readonly property FileDialog facePicker: FileDialog {
title: qsTr("Select a profile picture")
- acceptLabel: qsTr("Select")
- nameFilters: [`Image files (${Wallpapers.extensions.map(e => `*.${e}`).join(" ")})`]
- onAccepted: {
- Paths.copy(selectedFile, `${Paths.home}/.face`);
- Quickshell.execDetached(["notify-send", "-a", "caelestia-shell", "-u", "low", "-h", `STRING:image-path:${Paths.strip(selectedFile)}`, "Profile picture changed", `Profile picture changed to ${Paths.shortenHome(Paths.strip(selectedFile))}`]);
+ filterLabel: qsTr("Image files")
+ filters: Wallpapers.extensions
+ onAccepted: path => {
+ Paths.copy(path, `${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)}`]);
}
}
}