feat: implement unified toggle widget shortcut system across interfaces #29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Implement Toggle Widget Shortcut for All Interfaces, issue #22
This PR implements a unified toggle widget shortcut system across both Textual and Tkinter interfaces. The shortcut can be configured in settings and will be automatically converted between Textual and Tkinter formats.
Changes
Created
shortcuts.py
utility in_lib
folder with conversion functions:convert_to_textual_shortcut
: Converts Tkinter format (<Control-t>
) to Textual format (ctrl+t
)convert_to_tkinter_shortcut
: Converts Textual format to Tkinter formattest_shortcuts.py
Updated Tkinter interface to use the shortcut from settings:
secret_entry.py
: Now usestoggle_widget
from settings instead of hardcoded<Control-t>
date_entry.py
: Now usestoggle_widget
from settings instead of hardcoded<Control-Shift-C>
Textual interface was already using the correct format, no changes needed
Testing
Added test suite for shortcut conversion functions, see
test_shortcuts.py
Verified that shortcuts work in both interfaces:
Notes
ctrl+t
) is used as the canonical format in settings