Page MenuHomeWildfire Games

[gui] increase label space in chat
Needs ReviewPublic

Authored by Nescio on Feb 7 2020, 2:27 PM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

As pointed out by @Zeldt on the forums, “Filter:”, “To:”, and “Text:” are quite short strings in English, but other languages might need more space, therefore this patch increases the space from 34 to 72 pixels.

Test Plan

Check for typos.

Event Timeline

Nescio created this revision.Feb 7 2020, 2:27 PM
Owners added a subscriber: Restricted Owners Package.Feb 7 2020, 2:27 PM
Vulcan added a comment.Feb 7 2020, 2:35 PM

Successful build - Chance fights ever on the side of the prudent.

Link to build: https://jenkins.wildfiregames.com/job/docker-differential/1721/display/redirect

elexis added a subscriber: elexis.Feb 7 2020, 3:15 PM

See #4252. Engine.GetTextWidth would yield the actual size used, avoiding the issue that a fixed number of pixels may look ugly for english while still being too few for other languages.

https://wildfiregames.com/forum/uploads/monthly_2020_02/screenshot0003.png.be57ab748bc8077f4ca2b3e6c12b8e93.png

This one I thought was fixed by rP22134

Nescio added a comment.Feb 7 2020, 6:12 PM

See #4252. Engine.GetTextWidth would yield the actual size used, avoiding the issue that a fixed number of pixels may look ugly for english while still being too few for other languages.

Engine.GetTextWidth looks like JavaScript, but the text space is defined in XML? How does that work?

elexis added a comment.Feb 8 2020, 3:54 PM

The size property of GUI objects can be changed to the value return by GetTextWidth, there is an example in termsdialog.js, or search for Engine.GetTextWidth. (I suppose it'd be better as a C++ snapping or alignment feature.)

Nescio added a comment.Feb 9 2020, 9:44 AM

The size property of GUI objects can be changed to the value return by GetTextWidth, there is an example in termsdialog.js, or search for Engine.GetTextWidth. (I suppose it'd be better as a C++ snapping or alignment feature.)

Whilst I agree having the code automatically determine the correct space for translated texts, I believe implementing that is beyond my abilities. This patch may not be a perfect solution, but at least it's an improvement for most languages, and could help as a semi-temporary adjustment until someone else writes code to properly align things.

Nescio retitled this revision from [gui]: increase label space in chat to [gui] increase label space in chat.Mon, Jun 1, 11:04 AM