Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add overline option for Table rows #5637

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

akx
Copy link

@akx akx commented Jan 25, 2025

  • Closes no issue, I just needed this for an app and figured it could be useful.
  • I have followed the instructions in the PR template

This PR adds an overline option for egui_extras::TableRow, which is useful for visually grouping rows. The overline consumes no layout space.

A screenshot of the demo app, showing every 7th row getting an overline.

Screenshot 2025-01-25 at 14 40 08

Sorry, something went wrong.

@akx akx marked this pull request as ready for review January 25, 2025 13:22
@akx
Copy link
Author

akx commented Feb 11, 2025

Rebased.

@emilk
Copy link
Owner

emilk commented Mar 21, 2025

Sorry for the slow review - needs a merge fix for the screenshot test

@emilk emilk added the feature New feature or request label Mar 21, 2025
@akx akx force-pushed the table-overline branch from d07fbb4 to aab660b Compare March 22, 2025 16:12
@akx akx force-pushed the table-overline branch from aab660b to 59f10b9 Compare March 22, 2025 16:14
Co-authored-by: Emil Ernerfeldt <[email protected]>
@akx akx requested a review from emilk March 22, 2025 16:16
@akx
Copy link
Author

akx commented Mar 22, 2025

@emilk No worries – thank you for Egui, it's awesome! Rebased + updated snapshot + added your suggestion.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5637-table-overline
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@lucasmerlin
Copy link
Collaborator

I would expect the line to be centered between rows, but instead it seems to be shifted to the bottom? Is this intentional?

Screenshot 2025-03-25 at 08 51 11

@akx
Copy link
Author

akx commented Mar 25, 2025

I would expect the line to be centered between rows, but instead it seems to be shifted to the bottom? Is this intentional?

It's currently drawn on the zeroth pixel row of the table row it's overlining. I wasn't convinced that drawing it at a half-pixel offset upwards would be a good idea...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
egui_extras feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants