Skip to content

Comments

Allow EditField widgets to manage their own activation and keyboard focus#2147

Merged
myk002 merged 4 commits intoDFHack:developfrom
myk002:myk_editfield
Jun 2, 2022
Merged

Allow EditField widgets to manage their own activation and keyboard focus#2147
myk002 merged 4 commits intoDFHack:developfrom
myk002:myk_editfield

Conversation

@myk002
Copy link
Member

@myk002 myk002 commented May 13, 2022

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 EditField widgets don't need to do any manual handling of keyboard focus or widget activation/deactivation.

FilteredList got an update since it no longer needed to manually manage the state of its EditField. 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)

@myk002 myk002 marked this pull request as ready for review May 14, 2022 04:04
@myk002 myk002 force-pushed the myk_editfield branch 4 times, most recently from cac4db0 to c41dcc0 Compare May 18, 2022 23:50
@lethosor lethosor self-requested a review May 24, 2022 04:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

widget.EditField should be able to manage its own hotkey activation

1 participant