Skip to content
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

feat(state): click_at #36

Merged
merged 8 commits into from
May 22, 2024
Merged

feat(state): click_at #36

merged 8 commits into from
May 22, 2024

Conversation

EdJoPaTo
Copy link
Owner

Allows clicking at a given position.

Stores the last area and the y position where items are rendered to determine which identifier was clicked. When it was already selected, toggle it's open/close state.

@EdJoPaTo EdJoPaTo linked an issue May 15, 2024 that may be closed by this pull request
@EdJoPaTo
Copy link
Owner Author

click_at is useful for "don't care, just handle a click". With mqttui also the focus to the given widget is changed which requires knowledge whether something was actually there. So rendered_at is more useful there.

select_at is somewhat of a middle spot. It does the same as click_at except not toggling. But it doesnt allow as much flexibility as rendered_at.

For mqttui I only used click_at and rendered_at: EdJoPaTo/mqttui@3f6f4eb
So maybe remove select_at again? Either do exactly what you want with rendered_at or choose the best effort click_at?

Any thoughts @thscharler ?

src/tree_state.rs Outdated Show resolved Hide resolved
Signed-off-by: EdJoPaTo <github@edjopato.de>
src/tree_state.rs Outdated Show resolved Hide resolved
Signed-off-by: EdJoPaTo <github@edjopato.de>
@EdJoPaTo EdJoPaTo merged commit d23f55b into main May 22, 2024
58 checks passed
@EdJoPaTo EdJoPaTo deleted the select_item_at branch May 22, 2024 06:35
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.

Add getter for Item::Identifier
1 participant