-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Toggle switch #39161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Toggle switch #39161
Conversation
cool! |
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 |
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). 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. |
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. |
Yet another round of reflection has yielded the following thoughts:
|
Also worth noting that I will need to update this if #29903 is merged before it, which is looking likely. |
Ok this part might be APC-specific. Button does need better disabled appearance though. |
I'm still not too keen on the textures, I might give them an attempt |
There was a problem hiding this 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
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. |
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. |
Oh... Message is gone. Now I'm talking to myself Or not, github you dork |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this 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
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
There was a problem hiding this 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 👍
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
Adds switch button styles, converts APC power toggle to switch button, replaces
CheckButton
withButton
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 toButton
. This is not expected to cause any visible change, sinceCheckButton
is essentially a now-obsolete synonym forButton
. See space-wizards/RobustToolbox#6099 for more details.Media
The new control in the APC UI:


How the new control looks with the styles added here when it has a main label:

(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 ofCheckButton
should be replaced withButton
.Changelog
🆑