ted-marozzi / data-grid

High Performance Data Grid optimised for large numeric tables.
BSD 3-Clause "New" or "Revised" License
8 stars 4 forks source link

feat: spacing between columns #14

Closed defuncart closed 9 months ago

defuncart commented 2 years ago

Use case: I have two columns, left one is right aligned, and right is left aligned. I would like to add some space between them but keep the alignment.

What I tried: GridColumn & GridCell add padding EdgeInsets.only(right: 16) -> This will result in the cell being wider, correct padding is between row cells, however column cells will have padding between text and icon, when the desired result is between cells.

Solution: Add optional spacing between columns which defaults to 0.

Showcase: Here is the standard example Bildschirmfoto 2022-11-12 um 10 10 25 and here with column spacing of 24px which is applied evening between all columns and after the last column Bildschirmfoto 2022-11-12 um 10 10 03

Future ideas: Perhaps an enum could be introduced so that spacing is only between all columns, also between + before first, between + after last, or before first + between + after last.

ted-marozzi commented 2 years ago

Could you add a screenshot of what this looks like?

defuncart commented 2 years ago

@ted-marozzi Added screenshots. Will investigate the failing tests.

defuncart commented 2 years ago

Not sure why the tests are failing with pixel overflow, using the test code in example app leads to no pixel overflow.

ted-marozzi commented 2 years ago

Maybe try run that test code in the example as an end to end test to visually see whats going on

defuncart commented 2 years ago

Took another look and figured out the issue. Working nicely now 👍

defuncart commented 2 years ago

While merging #12 and #14 on a local branch, there are some merge conflicts and I think it is better to merge #12 and then #14 into master, as the solution to #14 should be updated once #12 is merged. Thus marking #14 as draft.

ted-marozzi commented 2 years ago

@defuncart #12 is merged now :)