Allow EditField widgets to manage their own activation and keyboard focus#2147
Merged
myk002 merged 4 commits intoDFHack:developfrom Jun 2, 2022
Merged
Allow EditField widgets to manage their own activation and keyboard focus#2147myk002 merged 4 commits intoDFHack:developfrom
myk002 merged 4 commits intoDFHack:developfrom
Conversation
cac4db0 to
c41dcc0
Compare
This was referenced May 19, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #2137
Requires #2160 for the focus subsystem
Scripts that use EditField will get a related PR in the scripts repo.
Now views that include
EditFieldwidgets don't need to do any manual handling of keyboard focus or widget activation/deactivation.FilteredListgot an update since it no longer needed to manually manage the state of itsEditField. This actually solved a long-standing bug that I was otherwise meaning to look into: now if you hit a number key that could be interpreted as an arrow key if you pressed it in the num pad (like 2), it will actually be input to the filter properly and not result in a list selection movement. So yay for that.Changes have been manually tested with:
gui/quickfort(uses FilteredList with no edit_key) (no script changes required)gui/autogems(uses FilteredList with an edit_key) (no script changes required)gui/blueprint(uses EditField with an activation key) (needed update to remove redundant logic))gui/gm-editor(uses EditField with an activation key and custom formatting) (needed update to remove redundant logic)