Skip to content

feat(linux-grid): shade alternate rows of the data grid - #3932

Merged
datlechin merged 5 commits into
TableProApp:mainfrom
sedax90:feat/linux-grid-alternate-rows
Oct 31, 2026
Merged

datlechin merged 5 commits into
TableProApp:mainfrom
sedax90:feat/linux-grid-alternate-rows

Conversation

@sedax90

@sedax90 sedax90 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Every other row of every data grid (table tab, query results, key tab) gets a light shade, on by default as on macOS.
  • Preferences, Data Browser, gains Show Alternate Row Backgrounds (GSettings key show-alternate-rows, default true). Each open grid follows the key live.
  • GTK 4.22 has no stripe API, and :nth-child cannot stripe recycled rows. Each cell's child takes a class from its row's position, so stripes stay right after scrolling and when a row is added above.
  • The shade is a static rule in style.css on var(--view-fg-color), stronger under high contrast, and stays off a selected row. No runtime CSS provider.
  • The cell padding moves to the cell's child, as in libadwaita's file chooser, so the stripe fills the cell. Row heights and column widths do not change.
  • The filler column gets an empty child, so the stripe reaches the right edge instead of stopping at the last column.
  • Fixed in the first version: the stripe rule was installed by the SQL editor, so a table or key tab opened without an editor had no stripes, and the switch stopped working once the last editor closed.

Test plan

  • every_other_row_is_striped_out_to_the_filler (the row number column, both data columns and the filler) and open_grids_follow_the_stripes_preference fail on the first version.
  • a_row_added_above_moves_the_stripes and recycled_rows_take_the_stripe_of_their_new_position (300 rows, scrolled to row 250) check that the stripe follows the position.
  • preference_rows_are_bound, plus defaults_match_schema and show_alternate_rows_round_trip in the storage tests.
  • CI runs the build, tests and lint. No local Linux build was available, so there are no screenshots.

Every other row of a data grid gets a light shade so a row reads across
its columns. A new Show Alternate Row Backgrounds switch in Preferences,
on by default as on macOS, turns it off. The shade follows the row's
position, since GTK recycles row widgets as the view scrolls, and stays
off a selected row.
GTK aborts when a list factory restyles the cell widget it is setting
up. The stripe class moves to the cell's child, which now carries the
cell padding, as in GTK's file chooser, so the shade spans the cell.
sedax90 pushed a commit to sedax90/TablePro that referenced this pull request Oct 31, 2026
@datlechin
datlechin merged commit 3007c7b into TableProApp:main Oct 31, 2026
37 of 38 checks passed
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.

2 participants