- cross-posted to:
- uiux@programming.dev
- hackernews@lemmy.smeargle.fans
cross-posted from: https://programming.dev/post/9907892
- macniel ( @DmMacniel@feddit.de ) 42•8 months ago
It should show the current state, just like a checkbox shows if its option is enabled, an input box its current value etc. Everything else doesn’t make sense.
- Admiral Patrick ( @ptz@dubvee.org ) English13•8 months ago
Exactly. A light switch* shows its current state, and toggle buttons are effectively an equivalent to that.
*Standard, two-way garden variety light switch
- nxdefiant ( @nxdefiant@startrek.website ) 12•8 months ago
I’d argue that a light switch has an indicator that shows the current state, separate from the switch.
- 💡𝚂𝗆𝖺𝗋𝗍𝗆𝖺𝗇 𝙰𝗉𝗉𝗌📱 ( @SmartmanApps@programming.dev ) English4•8 months ago
Not if the globe has blown out, in which case you need the switch to indicate which state it is in (unless you like to live dangerously and change globes in lights that may be still on :-) ).
- karlhungus ( @karlhungus@lemmy.ca ) 3•8 months ago
In my experience only kinda, and by convention (up is on), and three-way switches break this (indicator becomes the light itself).
- 💡𝚂𝗆𝖺𝗋𝗍𝗆𝖺𝗇 𝙰𝗉𝗉𝗌📱 ( @SmartmanApps@programming.dev ) English3•8 months ago
This would be correct if the post was about switches (which TBF many people made that mistake, including me initially), but it’s about buttons - buttons should show what action will result from clicking on them. e.g. “Cancel” on a button which is going to cancel your process. For a play/pause button it should show play if you’re paused (if I click on this it will start playing) and pause if you’re playing (if I click on this it will pause).
- macniel ( @DmMacniel@feddit.de ) 1•8 months ago
oh yeah true, I was thinking of toggle buttons instead of buttons that keep their state/don’t release: like the formatting buttons (bold, italic, underline, …) in a word processor. The latter strangely are also named ToggleButtons so that’s a big confusion.
- 💡𝚂𝗆𝖺𝗋𝗍𝗆𝖺𝗇 𝙰𝗉𝗉𝗌📱 ( @SmartmanApps@programming.dev ) English1•8 months ago
Yeah, the wording isn’t clear, and some people are talking about switches and some people are talking about buttons. I work with MAUI, and in MAUI a “ToggleButton” is called a Switch, so there’s no confusion there, but the OP specifically said a button which toggles. i.e. a button which has 2 states instead of just one. A play button which turns into a pause button when you press it and vice-versa. I think the OP may have been confused between switches and buttons themselves - which are indeed labelled in opposite ways to each other (switch - current state, button - state that it will cause to happen when pressed) - which led to the question.
- Pamasich ( @Pamasich@kbin.social ) 13•8 months ago
Depends on what the purpose of the button is.
A setting should show the current state, but an action (referring to the play button example) should show the state it’ll transition to.
- Rentlar ( @Rentlar@lemmy.ca ) 12•8 months ago
My rule is if it’s a Verb, then what it will do: “Enable”, “Join/Leave”, “Turn on/off”, “Play/Pause”
If it’s an adjective, noun or description of a state, then the condition is what is written. ON/OFF, Enabled, Joined/Left, “Repeating 1/Repeating ALL/Repeat OFF”
Shuffle/Random Play is ambiguous, but it’s either Shuffle ON, Shuffle OFF like the second category, or Shuffle/Unshuffle as the first category.
E: Added the media player example from the original thread.
- nxdefiant ( @nxdefiant@startrek.website ) 10•8 months ago
I don’t know what a great one is but I have an example of a terrible one:
the green/black glue gun has the worst on/off switch I’ve ever encountered.
You can’t see it in the picture, but the actual switch that arrow is pointing to has no text on or around it, so you’re left to pick up or down, plug it in, and wait a few minutes see if you were right.
- cosmic_skillet ( @cosmic_skillet@lemmy.ml ) 7•8 months ago
Wow that’s terrible design
- jadero ( @jadero@programming.dev ) 2•8 months ago
Knowing how a switch works in a circuit and how it’s typically represented in schematics, I would guess that moving the switch toward the body of the gun should be off.
But if actually placing a bet, I’d put my money on it being the other way.
- nxdefiant ( @nxdefiant@startrek.website ) 4•8 months ago
I carved “On” into mine, it’s exactly opposite of what you described.
- ITGuyLevi ( @ITGuyLevi@programming.dev ) 5•8 months ago
Personal opinion, but it should show a single state and if it is active.
- Gamma ( @GammaGames@beehaw.org ) English2•8 months ago
Why is this 13 year old stack overflow question being reposted
- λλλ ( @lambda@programming.dev ) 7•8 months ago
Weird, but I found it a super interesting read. It made me think of Home Assistant as one of the only software that I could think of that uses a toggle button from the top of my head. I think it handles these states wonderfully.
Edit: The big one I rarely see. But, either one seems quite intuitive.
- Gamma ( @GammaGames@beehaw.org ) English1•8 months ago
That’s fair, I use toggles somewhat regularly in web dev and semantic ui has nice styling for them. Not as fancy as home assistant though, those are very clear!
- λλλ ( @lambda@programming.dev ) 2•8 months ago
Right?!? I find their design to be some of the best I’ve seen. Even against proprietary software.
- 💡𝚂𝗆𝖺𝗋𝗍𝗆𝖺𝗇 𝙰𝗉𝗉𝗌📱 ( @SmartmanApps@programming.dev ) English2•8 months ago
Didn’t you get the memo? We’re doing away with privately-owned platforms and starting fresh in the Fediverse :-)