-
-
Notifications
You must be signed in to change notification settings - Fork 22k
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
CheckButton
checked/unchecked icon can be on both sides
#104463
base: master
Are you sure you want to change the base?
CheckButton
checked/unchecked icon can be on both sides
#104463
Conversation
FYI @njamster |
From an UX perspective, is there a good reason to invert the CheckButton position while staying on a given typesetting configuration (LTR or RTL)? I can understand the aesthetics aspect, but I wonder if this can decrease usability if not used carefully. |
f53c758
to
610c51d
Compare
If `inverted` is set to true on `CheckButton` the checked/unchecked icon will be drawn in the right for for right-to-left layouts or in the left for left-to-right layouts.
610c51d
to
23f72c3
Compare
If you are worried if this wont work when you switch from LTR or RTL (or vice-versa) the code takes that in consideration and
|
I think "invert" is too generic, at first glance I'd assume it meant the |
I may suggest Either way, me too. I'm unsure what purpose this serves UX-wise. Even if it was talked about, I'm not sure it's useful. |
|
Personally, I think a As to the purpose of this: I'll openly admit it's mostly motivated by aesthetics and personal preference. As mentioned in my talk, it can be worked around relatively easily – so personally I don't care if this is added or not. That being said, the workaround is quite verbose (involving three nodes and a script) for how little it achieves (moving the checkbox). |
You can work it around by swapping CheckBox icons with CheckButton's. You don't even need a script. godot.windows.editor.dev.x86_64_4qbZvu0Xnv.mp4 |
Nice catch, thanks! :) Still, I'd argue that using another node with a different texture isn't exactly an obvious solution to the problem, while the documentation recommends choosing between |
tbh we could merge CheckBox and CheckButton into a single class with 3 modes (checkbox, checkbutton, radio button), with option to display the icon on either side. But that's Godot 5 material. |
I believe this toggle should be part of the theme settings that could be overridden by the node, but usually if you set it in one Button, you want it to all of them, so changing it in the default theme sounds like the best place to do it. |
I'll try to come up with an updated version that address most of the comments |
If
inverted
is set to true onCheckButton
the checked/unchecked icon will be drawn in the right for for right-to-left layouts or in the left for left-to-right layouts.Naming is hard, so I'm open to name changes.
Inspiration: https://youtu.be/cJ5Rkk5fnGg?list=PLeG_dAglpVo6TS0q858NajyeglRuvb7hs&t=923