Skip to content

Replace platform-dependent info glyph in AI prefs model card with cairo-drawn icon#21097

Merged
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:model_card_icon
May 22, 2026
Merged

Replace platform-dependent info glyph in AI prefs model card with cairo-drawn icon#21097
TurboGit merged 1 commit into
darktable-org:masterfrom
andriiryzhkov:model_card_icon

Conversation

@andriiryzhkov
Copy link
Copy Markdown
Collaborator

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_button uses for its own icons – the glyph is now identical everywhere darktable runs.

The cell-renderer side of this is reusable: extracted as dtgtk_paint_cell under src/dtgtk/, so any future "draw a cairo paint in a tree column" need (help icons elsewhere, status indicators, etc.) is a one-line dtgtk_paint_cell_new(paint_fn, 0, NULL) call away.

Two new bits worth flagging:

  • dtgtk_cairo_paint_info in src/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_cell in src/dtgtk/paint_cell.{h,c} – generic cell renderer wrapping a DTGTKCairoPaintIconFunc. Mirrors dtgtk_button in shape (public struct fields, single constructor).
new_info_icon

@andriiryzhkov andriiryzhkov added scope: AI features AI features related issues and PR scope: UI user interface and interactions labels May 22, 2026
@andriiryzhkov andriiryzhkov added this to the 5.6 milestone May 22, 2026
@andriiryzhkov andriiryzhkov added priority: low core features work as expected, only secondary/optional features don't and removed priority: low core features work as expected, only secondary/optional features don't labels May 22, 2026
Copy link
Copy Markdown
Member

@TurboGit TurboGit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@TurboGit TurboGit added the bugfix pull request fixing a bug label May 22, 2026
@TurboGit TurboGit merged commit 570f642 into darktable-org:master May 22, 2026
5 checks passed
@andriiryzhkov andriiryzhkov deleted the model_card_icon branch May 22, 2026 16:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix pull request fixing a bug scope: AI features AI features related issues and PR scope: UI user interface and interactions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants