Skip to content

Conversation

@atlast-50
Copy link
Contributor

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:
image

@Capkirk123
Copy link
Collaborator

@eggrobin Looks good to me. Any opinions?

Comment on lines 70 to 77
var okStyle = new GUIStyle(Style.RightAligned(GUI.skin.label)){
focused = {
textColor = XKCDColors.Lime
},
normal = {
textColor = XKCDColors.Lime
}
};
Copy link
Member

@eggrobin eggrobin Mar 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

@atlast-50 atlast-50 requested a review from eggrobin March 21, 2025 23:29
@Capkirk123
Copy link
Collaborator

Seems to work as advertised. @eggrobin any objections to merging?

@eggrobin
Copy link
Member

@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.

@pleroy
Copy link
Member

pleroy commented Apr 12, 2025

On unrelated news, the work Disconnected is improperly aligned vertically (the same probably holds for the word OK but that's harder to see).

Pleeease get the styles from Principia's style.cs.

@eggrobin
Copy link
Member

the work Disconnected is improperly aligned vertically

How so?

Pleeease get the styles from Principia's style.cs.

It comes from there, this uses principia.ksp_plugin_adapter.Style.RightAligned.

@pleroy
Copy link
Member

pleroy commented Apr 12, 2025

This is the screen capture in the first comment, zoomed 4× with a guide:
Capture

@eggrobin
Copy link
Member

Ah yes, the Multiline style is upper-left aligned, whereas the RightAligned style is middle-right…

@pleroy
Copy link
Member

pleroy commented Apr 12, 2025

In Principia we set GUILayoutHeight(4) for multiline styles. It also avoids truncating the descenders of the J and g.

@eggrobin
Copy link
Member

In Principia we set GUILayoutHeight(4) for multiline styles

That seems specific to the reference frame description. But yes, we should do something about that Iamesburɑ in the screenshot.

@Capkirk123
Copy link
Collaborator

Is this acceptable now?

@eggrobin
Copy link
Member

No, we still need to do something about the alignment and the clipping of single-line text, see the discussion above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Long connection names don't fit in connection window

4 participants