Repository navigation
Ariadne: clickable groups (on_click, hover: highlight, on_hover_end), and {i} in a repeated row's handlers - #1063
Merged
Merged
Conversation
…nt and send
substitute_index() filled {i} into a repeat instance's id, label, bind, on, predicates,
tooltip and pictures, but not into on_click, on_hover, on_drag, on_drag_start,
on_drag_end, on_top, hint or send, so their programs saw a literal "{i}": room_users'
name cells opened tree.cam_{i} instead of the row's camera window. ARIADNE.md §6.5 now
lists what {i} covers, and ariadne_ftxui_test clicks and hovers rows of a repeat.
…over: highlight A feed's card could not be clicked as a whole: a group had no item of its own, so its on_click was its last child's in ImGui (or a table's, or a backdrop's), and nothing at all in the terminals, where text and pictures take no focus. Backend gets begin_item_group / end_item_group around such a group's children (one with on_click, on_hover, on_hover_end or hover: highlight); after it the group is the last item, so item_clicked, item_hovered, item_pointer and set_tooltip cover all of it. - ImGui: an InvisibleButton over the group once it is laid out. A button, checkbox or field inside it took the hover first and keeps its click. A click is a tap (released over it, not dragged past the threshold), so a finger scrolling a feed opens nothing. hover: highlight fills its area with the header-hover colour on a channel under it. - FTXUI / tvision: the group is an item. A press on its text or pictures is its own, and one with on_click takes focus: Tab reaches it before its widgets, Enter or Space fires it. A one-column gutter marks it (focus: a half block and a grey background; hover: highlight: a bar), always reserved so the layout never shifts. - The core keeps a click with the innermost taker: a widget with its own on_click, or a button, inside a clickable group fires and the group does not. - on_hover_end (any widget): once, when the pointer leaves or the widget goes. Capabilities::item_groups backs the new token ui.group_click. ARIADNE.md §5.19 documents it; ariadne_ftxui_test's GroupClick* / GroupHover* tests drive it by mouse and keys.
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.
A feed's card can now be clicked as a whole, in every stock backend, and
{i}reaches a repeated row's handlers. This is for nicotina's TX.WTF client: clicking a post opens it.{i}in handlers (a fix).substitute_index()filled{i}into id, label, bind, on, the predicates, tooltip and pictures. It missedon_click,on_hover,on_drag,on_drag_start,on_drag_end,on_top,hintandsend, so their programs saw a literal{i}.room_users.ari's name cells openedtree.cam_{i}, not the row's camera.A group with
on_click:is one item. This covers a group withon_click:,on_hover:,on_hover_end:orhover: highlight. Until now a group had no item of its own. In ImGui itson_clickwas its last child's (or a table's, or a backdrop's). In the terminals it was nothing, because text and pictures take no focus.begin_item_group/end_item_grouparound the group's children. After the bracket, the group is the last item, soitem_clicked,item_hovered,item_pointerandset_tooltipcover all of it.hover: highlightfills the area with the header-hover colour, on a draw-list channel under the content.on_click:takes focus: Tab reaches it before its widgets, and Enter or Space fires it.▌and a grey background for focus,│forhover: highlight. It is always reserved, so the layout never shifts.on_click:, a fullscreen picture or a button fires, and the group doesn't.on_hover_end:(any widget) runs once when the pointer leaves, or when the widget goes.ui.group_click(Capabilities::item_groups).Docs: ARIADNE.md §5.19 (new), §6.5 (what
{i}covers), and the §5.7 token table.Tests:
ariadne_ftxui_test:RepeatedRowsHandlersSeeTheirOwnIndex,GroupClickCoversTheCardButNotItsButton,GroupClickGoesToTheInnermostHandler,GroupHoverHighlightsAndReportsTheEnd.cvcgl_imgui_group_click: tap, button, drag and hover through ImGui's own input.ariadne_ftxui_test(89),ariadne_loader_test,ariadne_requires_testand all 15cvcgl_imgui_*tests pass. tvision isn't buildable on that box; CI covers it.