cogentcore / core

A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
http://cogentcore.org/core
BSD 3-Clause "New" or "Revised" License
1.32k stars 71 forks source link

Tableview: for long string fields, the units.Ch can end up overestimating length significantly #874

Open rcoreilly opened 4 months ago

rcoreilly commented 4 months ago

Describe the bug

e.g., in example/views -- once you select a filename, that column gets huge!

not clear exactly what to do about this. crazy version would be to count std char widths (i.e., have a table of std relative widths so that "i" is shorter than "M" etc). Maybe there is a better "ch" width rather than "x"?

It is not possible to get actual render width for everything in a column (could be very expensive for long tables!).

Also, could consider having user-adjustable column widths. This is nice but unless they are saved and restored, it ends up just being more work for the user vs. having a good default width algorithm.

How to reproduce

run examples/views, click on TableView, select a file in last column.

Example code

No response

Relevant output

No response

Platform

macOS