Skip to content

Conversation

Absotively
Copy link
Contributor

@Absotively Absotively commented Jul 23, 2025

Adds switch button styles, converts APC power toggle to switch button, replaces CheckButton with Button in three places.

Requires space-wizards/RobustToolbox#6099

About the PR

This adds styles for switch buttons and changes the APC power toggle to use a switch button.

I am leaving other power buttons/toggles for a later PR on the theory that how the button should look and where it should be used are mostly separate questions.

Why / Balance

The current toggle button for APC power only displays the status through the button colour. Also, I think "toggle" is not a very helpful button label. Using a switch-style button with state labels will hopefully be clearer.

Most or all of the gas manipulation devices also have unclear power toggling buttons, though they are different unclear power toggling buttons. This new control will hopefully be useful for them too, but for the sake of keeping this PR manageable they will be changed later rather than here.

There may be other off/on buttons that would be clearer if they were switch-style buttons, but many of them are two-button off/on groups, which are less unclear and so of lower priority to change.

Technical details

Textures and style rules for SwitchButton have been added to Resources/Textures/Interface/Nano and StyleNano.cs.

The APC menu has been changed to use a SwitchButton, and the string for the old toggle button's label has been removed.

Three instances of CheckButton in xaml files were changed to Button. This is not expected to cause any visible change, since CheckButton is essentially a now-obsolete synonym for Button. See space-wizards/RobustToolbox#6099 for more details.

Media

The new control in the APC UI:
image
image

How the new control looks with the styles added here when it has a main label:
image
(No instances of the new control with a main label are being added here, but when I replace gas manipulation device power switches in a later PR, I intend to convert the "Status:" labels to SwitchButton main labels. I don't plan to actually make the intercom change shown above, but it's a useful layout/style example.)

Requirements

Breaking changes

CheckButton is now obsolete. Any uses of CheckButton should be replaced with Button.

Changelog

🆑

  • tweak: APC power toggle now uses switch-style button

@PJBot PJBot added S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. Changes: UI Changes: Might require knowledge of UI design or code. labels Jul 23, 2025
@github-actions github-actions bot added the size/M Denotes a PR that changes 100-999 lines. label Jul 23, 2025
@Absotively Absotively marked this pull request as ready for review July 23, 2025 03:54
@beck-thompson
Copy link
Member

cool!

@Absotively
Copy link
Contributor Author

Upon further reflection, this could probably use a second style that is less attention-grabbing.

One of the removed CheckButton uses was the "Show Track Names" button on the midi channels dialog. Using an actual switch button for it might be an improvement to that dialog, but I think the bright green power indicator added here would be a bit much.
image

Probably there are other non-power things that would work well as switch buttons and benefit from a plainer style. I'll try to add a second style that harmonizes better with the standard control styles tonight.

I do think the bright indicator is probably good for power switches, which is why my plan is to add a second style rather than toning down this one.

@sowelipililimute sowelipililimute self-requested a review July 23, 2025 18:40
@VerinSenpai
Copy link
Contributor

I like the switch. I feel like the internal box could benefit from thicker lines.

Personally I feel like this looks a bit jank on the APC panel. I think itd look better to have the toggle remain a toggle button and when we eventually get networked device control on apcs have this be the breakers

@Absotively
Copy link
Contributor Author

In regards to the concern about colourblindness accessibility brought up in space-wizards/RobustToolbox#6099, I tried to make the thumb (the inner shape) much brighter in the "on" texture, in hopes that this would make the difference easily visible to people with red/green colourblindness. But I didn't check it in a colourblindness simulator before now, and I probably should have.

Here's what the current texture looks like through the Firefox dev console's colourblindness simulators. In order these are the simulators for protanopia (no red), deuteranopia (no green), tritanopia (no blue), and achromatopsia (no colour).
image
image
image
image

To my eye the off and on states look sufficiently different in all of these, though I am tempted to try tweaking the red to see if I could make it less bright in the tritanopia simulator.

I think a brighter outline might also help, because it would make the shape difference easier to see. I chose the current colour to match checkboxes, but it doesn't have especially strong contrast with dialog backgrounds.

@Absotively
Copy link
Contributor Author

In regards to this looking a bit jank on the APC panel, I wonder if making the icon shorter might help. I chose the height to match checkboxes, but it's substantially taller than the surrounding text and I think that's making it look awkward.

@Absotively
Copy link
Contributor Author

Textures take two: I have made these smaller, added a default style that uses the checkbox colours, and adjusted the power switch style.
image

The smaller icon fits a little better in the APC panel.
image

I changed the midi channels menu's "Show Track Names" button to a switch to provide an example of the new default style.
image

The red in the off power switch is a bit darker now, which increases the difference in brightness between the two states of the power version in the tritanopia simulator a bit. The lighter background in the on state also helps the states look more distinct.
image

@Absotively
Copy link
Contributor Author

Yet another round of reflection has yielded the following thoughts:

  • These need to sit a little further down in relation to the label text. Looking at checkboxes, I think the way to do this is probably just to make the images taller but have the top part be transparent.
  • Maybe they should be even shorter? Will need to make an even shorter version to compare.

@Absotively
Copy link
Contributor Author

Good news: I think I have the proportions and positioning better now.
image
image
image

Bad news: The button always appears to be in the off state if it is disabled, for instance if someone without engi access looks at an APC, so that needs fixing.

@Absotively
Copy link
Contributor Author

Also worth noting that I will need to update this if #29903 is merged before it, which is looking likely.

@Absotively
Copy link
Contributor Author

Bad news: The button always appears to be in the off state if it is disabled, for instance if someone without engi access looks at an APC, so that needs fixing.

Ok this part might be APC-specific. Button does need better disabled appearance though.

@sowelipililimute
Copy link
Member

I'm still not too keen on the textures, I might give them an attempt

@sowelipililimute
Copy link
Member

grafik grafik

i'm thinking something more in line with our sliders & other UI controls in size & styling, thoughts?

@sowelipililimute sowelipililimute removed the S: Untriaged Status: Indicates an item has not been triaged and doesn't have appropriate labels. label Aug 3, 2025
Copy link
Member

@sowelipililimute sowelipililimute left a comment

Choose a reason for hiding this comment

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

this is looking fine from the content side now

@PJBot PJBot added the S: Approved Status: Reviewed and approved by at least one maintainer; a PR may require another approval. label Aug 3, 2025
@VerinSenpai
Copy link
Contributor

Those look damn good. Honest opinion is that the On Off should be removed so just the switch does the talking.

@PJBot PJBot added the size/M Denotes a PR that changes 100-999 lines. label Aug 12, 2025
@Absotively
Copy link
Contributor Author

Those look damn good. Honest opinion is that the On Off should be removed so just the switch does the talking.

I think the On/Off state labels are likely to improve clarity more often than not, so I'm inclined to leave them there by default. They can now be removed from specific switches by setting the text for both to empty strings.

@VerinSenpai
Copy link
Contributor

Honestly not sure how much more clear an on off switch can get. I do believe there should be a colorblindness setting but a switch is a switch, it only has two settings.

@VerinSenpai
Copy link
Contributor

VerinSenpai commented Aug 13, 2025

Oh... Message is gone. Now I'm talking to myself

Or not, github you dork

Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Sep 11, 2025
Copy link
Member

@sowelipililimute sowelipililimute left a comment

Choose a reason for hiding this comment

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

one thing I forgot, please add an attributions.yml to document the copyright of these SVGs

@PJBot PJBot added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. labels Sep 11, 2025
@github-actions github-actions bot removed the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Sep 12, 2025
@PJBot PJBot added S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. and removed S: Awaiting Changes Status: Changes are required before another review can happen labels Sep 12, 2025
Copy link
Contributor

This pull request has conflicts, please resolve those before we can evaluate the pull request.

@github-actions github-actions bot added the S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted label Oct 19, 2025
Copy link
Contributor

@juliangiebel juliangiebel left a comment

Choose a reason for hiding this comment

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

Sadly this PR got hit by the StyleNano removal 😔
You have to move the styles you added to StyleNano to sheetlets but once you did that this PR is good to get merged 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Since this #28356 got merged these need to use sheetlets. Here is the forum post for the breaking change:
Space Station 14 Forum - Stylesheet Overhaul

Here is the PR for the updated UI documentation:
space-wizards/docs#269

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Should be able to update the styles sometime this week.

I will note that this isn't the only thing this PR needs; it's still waiting on the engine PR.

@PJBot PJBot added S: Awaiting Changes Status: Changes are required before another review can happen and removed S: Needs Review Status: Requires additional reviews before being fully accepted. Not to be replaced by S: Approved. labels Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Changes: UI Changes: Might require knowledge of UI design or code. D3: Low Difficulty: Some codebase knowledge required. P3: Standard Priority: Default priority for repository items. S: Approved Status: Reviewed and approved by at least one maintainer; a PR may require another approval. S: Awaiting Changes Status: Changes are required before another review can happen S: Merge Conflict Status: Needs to resolve merge conflicts before it can be accepted size/M Denotes a PR that changes 100-999 lines. T: UI / UX Improvement Type: UI and player facing interactive graphical interfaces

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants