New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow pressing Enter to accept file name - p2 #28
Comments
This attempts to improve the semantics of the filename field in file choosers. The old behaviour was essentially to ignore the return key when typing into the field. The new behaviour is to attempt to select an item when pressing the return key and, if an item is selected and the OK button is unlocked, focus is shifted to the OK button. The user can then press return to confirm the selection. Affects: #28
This commit contains a number of fixes. The implementation of file selection modes [0] worked, but there was an interaction with code that was written _after_ the PR was written but _before_ the PR was merged. This change adjusts the behaviour to allow that code to work properly. A cancel() method was added to file choosers to allow for closing them reliably. This is not expected to be useful outside of the test suite, where ensuring that all file choosers are closed between each test run is desirable. This also makes a few adjustments to the test suite to reduce some fragility. [0]: #27 Affects: #28
This isn't quite what you asked for, but I believe the implementation is slightly better in terms of predictability: Pressing Return completes the text field, and selects the item in the directory, and then shifts focus to the Open button. Pressing Return a second time will obviously then press the Open button. The predictability comes from the fact that pressing Return consistently only closes the chooser if the Open button has focus. |
Release: com.io7m.jwheatsheaf 3.0.0 A big thanks to @DaveJarvis for suggestions, bug reports, and some code contributions! Change: Add the ability to specify custom strings (Ticket: #7) Change: Add the ability to confirm file selections (Ticket: #17) Change: Allow for including ".." in directory listings (Ticket: #23) Change: Improve "select directly" dialog behaviour (Ticket: #29) Change: Fix the size formatter (Ticket: #30) Change: Use the default filesystem by default (Ticket: #21) Change: Add support for glob-based filters (Ticket: #19) Change: Improve filename field behaviour (Ticket: #28) Change: Add an optional home directory button (Ticket: #12) Change: Enable sorting of directory items (Ticket: #22) Change: Allow for setting a default file filter (Ticket: #9) Change: Allow the escape key to close file choosers (Ticket: #14) Change: Allow for specifying an initial filename in choosers (Ticket: #15) Change: Allow for specifying custom dialog titles (Ticket: #8) Change: Make the default filters part of the public API (Ticket: #10)
Release: com.io7m.jwheatsheaf 3.0.0 A big thanks to @DaveJarvis for suggestions, bug reports, and some code contributions! Change: Add the ability to specify custom strings (Ticket: #7) Change: Add the ability to confirm file selections (Ticket: #17) Change: Allow for including ".." in directory listings (Ticket: #23) Change: Improve "select directly" dialog behaviour (Ticket: #29) Change: Fix the size formatter (Ticket: #30) Change: Use the default filesystem by default (Ticket: #21) Change: Add support for glob-based filters (Ticket: #19) Change: Improve filename field behaviour (Ticket: #28) Change: Add an optional home directory button (Ticket: #12) Change: Enable sorting of directory items (Ticket: #22) Change: Allow for setting a default file filter (Ticket: #9) Change: Allow the escape key to close file choosers (Ticket: #14) Change: Allow for specifying an initial filename in choosers (Ticket: #15) Change: Allow for specifying custom dialog titles (Ticket: #8) Change: Make the default filters part of the public API (Ticket: #10)
12.pdf
(ensure that the Save button is enabled)Enter
Expected: Full path to
12.pdf
is returned to the application and the dialog closes.Actual: Nothing happens.
The text was updated successfully, but these errors were encountered: