Add Toolbar and ToolbarButton widgets - #569
Merged
Merged
Conversation
A toolbar strip whose buttons hold a glyph and a label inside one frame. ToolbarButtonLayout places the label beside the glyph, centred below it, as the tooltip of a glyph-only button, or alone. A GlyphAbove toolbar is two lines tall so every button can put its label under its glyph. The layout arithmetic lives in the ImGui-free ToolbarGeometry, covered by unit tests; the widgets have an isolation suite, a demo section and a gallery tile. Closes #568. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Drads1iNzcCuWc8iJ6iGMw
|
This was referenced Oct 1, 2026
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.



Before: there was no toolbar widget. An application built its own row of icon buttons from plain
ImGui.Buttoncalls, with the glyph and the label as separate items.After:
ImGuiWidgets.Toolbar(id, options)opens a strip as ausingscope.ToolbarButton,ToolbarToggleButtonandToolbarSeparatorgo inside it and are laid out left to right. Each button draws its glyph and its label inside one frame.ToolbarButtonLayoutdecides where the label goes:GlyphLeading: beside the glyph. This is the default.GlyphAbove: centred under the glyph.GlyphOnly: no label on the button; the label becomes the tooltip.LabelOnly: the label alone.A
GlyphAbovetoolbar is two lines tall, so every button in it can put its label under its glyph.Closes #568. Stacked on #542 (
claude/asset-browser-026l9x).How:
ToolbarGeometry, which takes plain sizes and needs no ImGui context, so every number is unit-tested.GlyphAbovebutton inside a single-line toolbar falls back toGlyphLeading.Treeuses.Two demo-suite tests fail locally:
EverySection_CanBeExpandedWithoutErrorandAdvancedDemos_ListsEverySection. The cause isktsu.png, which is a Git LFS pointer in this checkout. They fail the same way on the base branch without this change, and CI fetches LFS.🤖 Generated with Claude Code
https://claude.ai/code/session_01Drads1iNzcCuWc8iJ6iGMw
Generated by Claude Code