Fixed display of multiline network status labels#33
Fixed display of multiline network status labels#33atlast-50 wants to merge 4 commits intomockingbirdnest:masterfrom
Conversation
|
@eggrobin Looks good to me. Any opinions? |
Telecom/main_window.cs
Outdated
| var okStyle = new GUIStyle(Style.RightAligned(GUI.skin.label)){ | ||
| focused = { | ||
| textColor = XKCDColors.Lime | ||
| }, | ||
| normal = { | ||
| textColor = XKCDColors.Lime | ||
| } | ||
| }; |
There was a problem hiding this comment.
| var okStyle = new GUIStyle(Style.RightAligned(GUI.skin.label)){ | |
| focused = { | |
| textColor = XKCDColors.Lime | |
| }, | |
| normal = { | |
| textColor = XKCDColors.Lime | |
| } | |
| }; | |
| var okStyle = Style.RightAligned(GUI.skin.label); |
Let’s not create ad hoc new styles with new colours in the middle of the rendering like that. Just use the error style for disconnected, and the default colour for OK.
|
Seems to work as advertised. @eggrobin any objections to merging? |
Yes, the code style is all over the place (this codebase uses snake_case and consistently avoids using directives for UnityEngine). I’ll fix it. |
|
On unrelated news, the work Pleeease get the styles from Principia's |
How so?
It comes from there, this uses principia.ksp_plugin_adapter.Style.RightAligned. |
|
Ah yes, the Multiline style is upper-left aligned, whereas the RightAligned style is middle-right… |
|
In Principia we set |
That seems specific to the reference frame description. But yes, we should do something about that Iamesburɑ in the screenshot. |
|
Is this acceptable now? |
|
No, we still need to do something about the alignment and the clipping of single-line text, see the discussion above. |
Fixes #6. As connections might be on multiple lines to keep the position of the 'OK' and 'Disconnected' labels consistent I've split that into a separate label that's right justified, and also colored it green or red respectively because colors are nice :)
How things look with this PR:
