linux: Tweak file chooser dialogs (#14526)

Mostly some small tweaks to the file chooser dialogs.

Fixes https://github.com/zed-industries/zed/issues/14127 (along with the
`ashpd` update in https://github.com/zed-industries/zed/pull/14401)

Also included a fix
(971d67c994)
for an issue that made multiple file chooser dialogs pop up on Wayland
when doing CTRL + O and quickly pressing the escape key.

Release Notes:

- N/A
This commit is contained in:
apricotbucket28 2024-07-15 21:27:46 -03:00 committed by GitHub
parent abc5abcd8b
commit 3407256aa3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 7 additions and 14 deletions

View file

@ -264,24 +264,15 @@ impl<P: LinuxClient + 'static> Platform for P {
let (done_tx, done_rx) = oneshot::channel();
self.foreground_executor()
.spawn(async move {
let title = if options.multiple {
if !options.files {
"Open folders"
} else {
"Open files"
}
let title = if options.directories {
"Open Folder"
} else {
if !options.files {
"Open folder"
} else {
"Open file"
}
"Open File"
};
let request = match OpenFileRequest::default()
.modal(true)
.title(title)
.accept_label("Select")
.multiple(options.multiple)
.directory(options.directories)
.send()
@ -322,8 +313,7 @@ impl<P: LinuxClient + 'static> Platform for P {
.spawn(async move {
let request = match SaveFileRequest::default()
.modal(true)
.title("Select new path")
.accept_label("Accept")
.title("Save File")
.current_folder(directory)
.expect("pathbuf should not be nul terminated")
.send()