Opened 8 years ago

Closed 2 years ago

Last modified 2 years ago

#4252 closed defect (fixed)

Dynamic chat label resizing

Reported by: elexis Owned by: bb
Priority: Should Have Milestone: Alpha 26
Component: UI – In-game Keywords: simple
Cc: Patch: phab:D2623

Description (last modified by bb)

The labels "To:" and "Text:" in the chat window are properly formatted in english, but some languages need more space than had been allocated when the strings and labels were introduced in r17771. Just using the maximum size to fit all language yields ugly results in enlgish, see screenshot: A better approach were to resize the label and text boxes dependent on the actual length. There is Engine.GetTextWidth() that should be able to accomplish that.

Attachments (2)

addressee_size_issue.jpg (496.8 KB ) - added by elexis 8 years ago.
This is how it would look if we were just to follow hardcoded sizes that are compatible with long-strings.
chat_window_stupid_resize_v1.patch (1.5 KB ) - added by elexis 8 years ago.

Download all attachments as: .zip

Change History (10)

by elexis, 8 years ago

Attachment: addressee_size_issue.jpg added

This is how it would look if we were just to follow hardcoded sizes that are compatible with long-strings.

by elexis, 8 years ago

comment:1 by Vladislav Belov, 7 years ago

Description: modified (diff)

I think it's easy to make the CText/CInput to be autoresized, but there's the another problem: if the text width intersects with the input width, then we need to move and resize the input too. So, or we make it on JS part, which should be easy too, but it needs to repeat for any such case; or we make something like view (rowview, cellview, tableview) which autoaligns all elements by their sizes and size priorities.

comment:2 by elexis, 7 years ago

Such a GUI object would be versatile and useful, but we should gather some actual use cases before implementing it for only the chat window.

I could imagine the "more options" window of the gamesetup using such an aligned view, but the existing view doesn't really need it since the labels support 2 lines, providing enough space.

comment:3 by Imarok, 5 years ago

Component: UI & SimulationIn-game UI

Move tickets to In-game UI as UI & Simulation got some sub components.

comment:4 by Silier, 3 years ago

Keywords: simple removed
severity: simple

comment:5 by Silier, 3 years ago

Keywords: simple added

comment:6 by bb, 3 years ago

Description: modified (diff)
Patch: phab:D2623

comment:7 by bb, 2 years ago

Owner: set to bb
Resolution: fixed
Status: newclosed

In 26349:

Create a 3rd party gui alignment class for objects.
Use the class for the chat to accomodate size issues in some languages.

Chat size issue reported by: Zeldt on forums
Initial solution by: Nescio
Comments By: elexis, nwtour, Freagarach, vladislav, wraitii

Differential Revision: D2623
fixes #4252

comment:8 by bb, 2 years ago

Milestone: BacklogAlpha 26
Note: See TracTickets for help on using tickets.