Skip to content

fix(linux-grid): count the sort arrow in a header's width and measure columns again when a font changes - #3927

Merged
datlechin merged 5 commits into
mainfrom
fix/linux-grid-header-arrow-and-font-change
Oct 31, 2026
Merged

datlechin merged 5 commits into
mainfrom
fix/linux-grid-header-arrow-and-font-change

Conversation

@datlechin

@datlechin datlechin commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Summary

  • A sortable column sized by its header now counts the sort indicator GTK keeps beside the title (16 px plus a 6 px gap), so the title and arrow are no longer clipped.
  • The header width is measured in the style Adwaita draws it in, .caption-heading: bold at 82 % of the grid's font.
  • Changing the interface font, the text size or the monospace font while a grid is open measures the columns the grid sized itself again. Widths the user set stay as they are. The row number column refits as well.
  • The font settings reach the grid through WidgetImpl::system_setting_changed (Dpi, FontName, FontConfig), and the monospace font through AdwStyleManager notify::monospace-font-name. That handler is dropped at dispose.
  • A grid that was out of its window when a font changed, or was sized before it had one, measures again when it is rooted in fonts other than the ones it measured in. Measuring reads a fresh Pango context, since a widget's own follows a change only at the next frame.

Follow-up to #3895.

Test plan

  • ui::data_grid::tests::columns:
    • a_sorted_columns_header_shows_its_title_and_arrow_whole
    • a_text_size_change_measures_the_grids_columns_again
    • a_monospace_font_change_measures_the_grids_columns_again
    • a_grid_back_in_its_window_takes_a_text_size_it_missed
  • CI runs the build, tests and lint. The local Linux container was removed to free disk space, so no local run and no screenshots.

@datlechin
datlechin merged commit 5fd3a35 into main Oct 31, 2026
36 checks passed
@datlechin
datlechin deleted the fix/linux-grid-header-arrow-and-font-change branch October 31, 2026 10:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant