News for hackers. Stuff that matters.
Re:Should toggle button show its current state or the state ... by mrighele on Monday February 12, 2024 @12:45PM (#39347890)
The main issue with toggle buttons is that you have an object that at the same contain the state of the system and the action to change it.

The consequence is that it is not clear if the "ON" that you see on it is the current state (so pressing on it will turn it to "OFF"), or the action that you will invoke when you press it.

The solution is to separate (part of) state and action, and this can be done in a few ways. One possibility is to do like one of the answers in the link suggests, and write the label _outside_ the button. If you don't have a switch but a toggle button (like the teams example in some other comment), leave the icon alone, and change some other properties of the button (for example leaving it pressed to signal the "ON" state, like it has been done for decades without any issue....)

Re:Should toggle button show its current state or the state ... by vleaflet on Monday February 12, 2024 @02:13PM (#39348948)
System sound properties in Windows 11 has an option "Allow apps and Windows to use this device for audio" and a button labeled "Don't allow" next to it. So what is the current state? I have no idea.