Repository navigation
Centre toolbar glyphs by their drawn pixels, add GlyphSize, and fix the gallery tile's icons - #576
Merged
Merged
Conversation
…'s Bold icon An icon font merged into the text font keeps its own vertical metrics, so glyphs drew high in their line box: above the label's midline in a leading button, and with a gap under them in a glyph-above button. Buttons now centre a glyph's drawn pixels in a slot one font size tall, so every glyph in a row sits level and labels stay aligned. The gallery tile's Bold toggle used U+E238, which falls inside the Nerd Font's Font Awesome Extension block and drew that font's glyph instead of Material's format_bold. It is now a Preview toggle on U+E8F4, which no Nerd Font range claims. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Drads1iNzcCuWc8iJ6iGMw
A toolbar or a single button can now draw its glyph at its own pixel size, from the same font, so icons can be larger than the labels beside them. The toolbar's row grows to fit its glyph size; labels stay at the font size. The gallery tile shows a 24px two-line toolbar, and swaps U+E8B8 (settings), which the Nerd Font's Devicons block claims, for Material's tune at U+E429. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Drads1iNzcCuWc8iJ6iGMw
…-5le24s # Conflicts: # CLAUDE.md
|
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: in the Toolbar gallery tile, icons sat high in their buttons. A leading icon sat above the label's midline, and an icon placed above its label left a gap under it. The Bold toggle drew a radioactive symbol instead of a bold "B". Icons could only be drawn at the label's font size.
After: the drawn pixels of each icon are centred in a slot one glyph size tall, which is the same for every glyph. Icons line up with their labels, labels in a glyph-above row stay level, and the tile draws the intended icons. A new
GlyphSizeoption (in pixels) onToolbarOptionsandToolbarButtonOptionsdraws icons larger or smaller than their labels, from the same font.An icon font merged into a text font keeps its own vertical metrics, so centring the line box leaves the icon off-centre.
ToolbarButtonnow reads the ink bounds of the glyph from the baked font. The pure correction isToolbarGeometry.GlyphInkCorrection, which is unit-tested. Horizontal ink centring only applies where the glyph is centred (GlyphOnly and GlyphAbove). A leading glyph keeps its advance, so the gap between glyph and label stays the style's.GlyphSizeresolves in this order: the button's own value, then the toolbar's value, then the current font size. The glyph is measured and drawn withImGui.PushFont(ImGui.GetFont(), size), so it needs no extra font registration. A toolbar'sGlyphSizegrows its row through a newToolbarGeometry.RowHeightoverload that takes a separate glyph line height. The existing overload is kept and delegates to it. A button whose own glyph is larger than its toolbar's is taller than the row, and the doc comment says to set the size on the toolbar instead.Gallery icons: U+E238 (format_bold) falls inside the Nerd Font's Font Awesome Extension range (E200–E2A9), and U+E8B8 (settings) falls inside its Devicons range (E700–E8EF). The merge keeps the first font's glyph, so the Nerd Font's icon won both times. The tile now uses Preview (U+E8F4) and Tune (U+E429), which no Nerd Font range claims. Its two-line toolbar also shows
GlyphSize = 24.How: I rendered the tile locally with the pinned Material Icons font (
--only Toolbar) and compared it against main's image. The gallery bot regeneratesdocs/galleryafter merge. These pass after merging current main: ImGui.Widgets.Tests (982, including two newRowHeightcases), the Toolbar isolation tests (21, including four newGlyphSizetests), WidgetGallery.UITests, and the demo's Toolbar test.🤖 Generated with Claude Code
https://claude.ai/code/session_01Drads1iNzcCuWc8iJ6iGMw