This repository has been archived by the owner on Jun 8, 2021. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for file chooser buttons
This commit adds support for file chooser buttons. They are represented as a slice of tuples `(text, action)`. The original function uses varargs to support an arbitrary number of arguments. This implementation supports up to 3 buttons. **This is a breaking change.** See: https://developer.gnome.org/gtk3/stable/GtkFileChooserDialog.html#gtk-file-chooser-dialog-new Improve file chooser with buttons reliability Following the reviews in #602, this commit: - uses the `with_buttons` function instead of modifying `new` to keep backward compatibility. - saves the button texts in `Stash` objects to avoid invalid pointers - panics when the number of buttons is too high (instead of silently truncating the number of buttons) Remove doc comment for `FileChooserDialog::with_buttons` Remove local variables in `FileChooserDialog::with_buttons` This commit removes the Stash variables from `FileChooserDialog::with_buttons`, as requested in the PR #602 Fix formatting issue Keep `downcast_unchecked` method on the same line as the closing parenthesis of the chopped-down call to `Widget::from_glib_none`.
- Loading branch information