summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
author2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-22 16:29:38 +1000
committer2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>2025-07-22 16:29:38 +1000
commit32ff695d9e2993fcc904a58b3f5486b2285e8825 (patch)
treec4e547a8f9f48e5c80a8dee6020a93a8d657b563 /utils
parentfiledialog: add scrollbar (diff)
downloadcaelestia-shell-32ff695d9e2993fcc904a58b3f5486b2285e8825.tar.gz
caelestia-shell-32ff695d9e2993fcc904a58b3f5486b2285e8825.tar.bz2
caelestia-shell-32ff695d9e2993fcc904a58b3f5486b2285e8825.zip
filedialog: better icon filtering
Only thumbnail valid image types Also move wallpaper extensions into separate singleton in utils
Diffstat (limited to 'utils')
-rw-r--r--utils/Images.qml12
1 files changed, 12 insertions, 0 deletions
diff --git a/utils/Images.qml b/utils/Images.qml
new file mode 100644
index 0000000..a006d32
--- /dev/null
+++ b/utils/Images.qml
@@ -0,0 +1,12 @@
+pragma Singleton
+
+import Quickshell
+
+Singleton {
+ readonly property list<string> validImageTypes: ["jpeg", "png", "webp", "tiff", "svg"]
+ readonly property list<string> validImageExtensions: ["jpg", "jpeg", "png", "webp", "tif", "tiff", "svg"]
+
+ function isValidImageByName(name: string): bool {
+ return validImageTypes.some(t => name.endsWith(`.${t}`));
+ }
+}