haganbmj / MagicSetEditor2

Magic Set Editor is a program for designing trading cards
Other
17 stars 7 forks source link

Stats tab name column is too narrow. #71

Closed G-e-n-e-v-e-n-s-i-S closed 5 months ago

G-e-n-e-v-e-n-s-i-S commented 7 months ago

The name column of the stats tab is too narrow: StatsColumn It is just barely wide enough for English, but we started doing some localization, and for Latin languages like French, Italian and Spanish, which are less concise than English, this will not be enough. Making it adapt to the length of the longest name is probably overkill, but increasing it's width by a flat 50% or 70% is necessary.

haganbmj commented 7 months ago

Increasing it by a static value is easy enough, doing it dynamically based on the widest cell might be a bit tedious since it would require restructuring some of the draw logic. There seems to be a lot of dead code in that file too.

PR to just increase it statically: https://github.com/haganbmj/MagicSetEditor2/pull/72

This call to getTextExtent is probably what would need to be called as early as possible against the entire dimension list. Find the max of that then apply the width to all of the elements, unfortunately it wants to know the size ahead of time before drawing any rows right now.

https://github.com/haganbmj/MagicSetEditor2/blob/d5f89637b984253c3358b3cdd4d279262f49ceaf/src/gui/set/stats_panel.cpp#L247