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

Optimal TableView Real State Management #138

Open
khaf opened this issue Feb 5, 2020 · 3 comments
Open

Optimal TableView Real State Management #138

khaf opened this issue Feb 5, 2020 · 3 comments

Comments

@khaf
Copy link

khaf commented Feb 5, 2020

While TableViews are implemented as standard, there are a few improvements that could improve their foot print on the screen:

  1. An option to allow to omit the scrollbars, and automatically not show the scrollbar when there is no need for it (number of rows, columns fewer than the provided space).
  2. Add an option to automatically expand or shrink the columns to fill the grid.
  3. Allow multi-row titles when a title contains \n
  4. As an expansion of the above, if two or more adjacent columns in a row are the same, unify that column+row. Example: Adjacent columns with titles Objects\nMaster and Objects\nReplica should be rendered like:

Screen Shot 2020-02-05 at 10 53 01 AM

@VladimirMarkelov
Copy link
Owner

I agree that the proposal looks better than the library has at this moment. The current look is basic, though it is easy to implement and maintain. I would not be surprised if the proposal doubles the amount of the code.

  1. It looks a little change. Yet it needs fixing: mouse click event that now must check visibility and draw method.
  2. Add a new special value for column width? E.g, -1 and all columns that have it expand to fill the extra space. In this case all those fields would be equal in width. Adding extra attribute may make expanding scaled by original width. It does not look a big change, too
  3. (+.4) A very big change, especially if we want to implement automatic merging of adjacent columns with similar names. Limiting header to only 2 lines helps a bit. Anyway, so many places needs rewriting: header size calculations(1 or N rows), drawing of "sort" symbol becomes not so trivial, drawing lines/headers changes, mouse click processing(and what happens if I click on "Objects" in the middle on the example above?). I do not say it is impossible :) It just takes much time to do and test.

@khaf
Copy link
Author

khaf commented Feb 6, 2020

I already have done 3 and 4; easier than I thought. I'll make a PR soon. The only challenge was finding the magic numbers in the code that represented the top row + 1 border. Mouse and Sort markers work properly. It also works for as many levels as the user wants to.

1 ended up being hard. I guess there are too many magic numbers. Hiding the scrollbars is easy, but using the space underneath wasn't. I'll give it another go later.

2 should be very easy. I haven't done it, but soon will and make a PR.

Thank you for being positive regarding the feature requests. I appreciate it.

@VladimirMarkelov
Copy link
Owner

It sounds great! Looking forward to PR

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

No branches or pull requests

2 participants