diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-20 15:56:24 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-07-20 15:56:24 +1000 |
| commit | 75964fe6081f96a4c0a82a3ec267c1d04b4179a1 (patch) | |
| tree | c939167d0d643a6f67652647478fdb97c8d0c52e /widgets/filedialog/FileDialog.qml | |
| parent | filedialog: add current item (diff) | |
| download | caelestia-shell-75964fe6081f96a4c0a82a3ec267c1d04b4179a1.tar.gz caelestia-shell-75964fe6081f96a4c0a82a3ec267c1d04b4179a1.tar.bz2 caelestia-shell-75964fe6081f96a4c0a82a3ec267c1d04b4179a1.zip | |
filedialog: add filters and buttons
Diffstat (limited to 'widgets/filedialog/FileDialog.qml')
| -rw-r--r-- | widgets/filedialog/FileDialog.qml | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/widgets/filedialog/FileDialog.qml b/widgets/filedialog/FileDialog.qml index 85103c7..33bae6a 100644 --- a/widgets/filedialog/FileDialog.qml +++ b/widgets/filedialog/FileDialog.qml @@ -8,14 +8,23 @@ FloatingWindow { id: root property list<string> cwd: ["Home"] + property string filterLabel: "All files" + property list<string> filters: ["*"] + + readonly property bool selectionValid: { + const item = folderContents.currentItem; + return item && !item.fileIsDir && (filters.includes("*") || filters.includes(item.fileSuffix)); + } signal accepted(path: string) + signal rejected implicitWidth: 1000 implicitHeight: 600 color: Colours.palette.m3surface onAccepted: visible = false + onRejected: visible = false RowLayout { anchors.fill: parent @@ -39,10 +48,18 @@ FloatingWindow { } FolderContents { + id: folderContents + Layout.fillWidth: true Layout.fillHeight: true dialog: root } + + DialogButtons { + Layout.fillWidth: true + dialog: root + folder: folderContents + } } } |