Replace platform-dependent info glyph in AI prefs model card with cairo-drawn icon#21097
Merged
Merged
Conversation
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.
The info icon next to each model in the AI preferences was a unicode glyph (
ⓘ, U+24D8). How it renders depends on the system's font fallback chain – it looked different on macOS, Windows, and across Linux distros, sometimes a tiny circled "i", sometimes a fat blob. Bad UX for an icon that's supposed to invite clicking.Replaced it with a cairo-drawn icon, same approach
dtgtk_buttonuses for its own icons – the glyph is now identical everywhere darktable runs.The cell-renderer side of this is reusable: extracted as
dtgtk_paint_cellundersrc/dtgtk/, so any future "draw a cairo paint in a tree column" need (help icons elsewhere, status indicators, etc.) is a one-linedtgtk_paint_cell_new(paint_fn, 0, NULL)call away.Two new bits worth flagging:
dtgtk_cairo_paint_infoinsrc/dtgtk/paint.c– the "i in a circle" glyph itself. Stroked at the same line weight (line_scaling=1) as the rest of DT's icons, so it sits visually alongside button icons.dtgtk_paint_cellinsrc/dtgtk/paint_cell.{h,c}– generic cell renderer wrapping aDTGTKCairoPaintIconFunc. Mirrorsdtgtk_buttonin shape (public struct fields, single constructor).