Skip to content
Discussion options

You must be logged in to vote

Hi, and thanks for the report!

Currently focus in cursive is not global, but decided per parent view. Each parent in your chain (dialog, layout, sublayout, sublayout's horizontal layout children) keeps its own focus state. So the manual way to ensure some view ends up "focused" is to make each parent in the chain focus the correct child down the chain.

take_focus is to tell a view that it just received focus, and that it should possibly update its own internal focus (in case it's a parent).

Here's what happens in your "Home" event handler:

  • dialog.set_focus(DialogFocus::Content): update the dialog's own focus to the content.
  • b.take_focus(Direction::up()): update the top sublayout's to beh…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@jwodder
Comment options

Answer selected by jwodder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants