godot icon indicating copy to clipboard operation
godot copied to clipboard

Toggle control expand flag via top bar

Open RedMser opened this issue 3 years ago β€’ 9 comments

Fixes #81726

  • Opening the container sizing popup loads the current value for the "Expand" checkbox, based on user's selection.
  • Clicking on the checkbox immediately toggles the flag for the selected controls.
  • Rename the checkbox from "Align with Expand" to just "Expand", since it now directly affects the flag.

https://user-images.githubusercontent.com/5117197/188201069-4044cc0e-d703-403b-818e-bfacb3ddb372.mp4

RedMser avatar Sep 02 '22 16:09 RedMser

CC @YuriSizov since you created #63358 which this PR expands (hah) upon.

RedMser avatar Sep 02 '22 16:09 RedMser

The current system was made this way on purpose, so I'm not sure if this is a good change. No other button in this or anchors' popup behaves like that and updates to match the state of the selected nodes.

YuriSizov avatar Sep 02 '22 17:09 YuriSizov

I tried working with the current system (I'm working mainly on applications, so very UI-heavy stuff). The new top bar felt very cumbersome to use without my change in place.

While from a programming standpoint I totally understand why it was created this way, for actual users creating UIs I don't think this is a good design. Users like to get instant feedback on their changes, see what each option does and how it affects the layout.

An alternative that does not involve updating based on selection state would be to have a "Toggle Expand" button, which does not show the state, but only requires a single click to toggle the flag instead of two.

If you want, I can open a proposal for this change first and get some more opinions in.

RedMser avatar Sep 02 '22 17:09 RedMser

@RedMser Yes, those are the options that we have, and the same ones I had to consider before arriving to the current state. I also work primarily with UI in Godot and understand the workflows. But none of these options are good in my opinion, including the current state. I just found it to be more consistent than others, but ultimately I don't like any of them.

So I'm all for a better option, I'm just not sure that this is better (because it's inconsistent with the rest).

Edit: And to be clear, if this is otherwise approved, I'm not going to die on that hill. πŸ™ƒ If this feels better, then it's better.

YuriSizov avatar Sep 02 '22 17:09 YuriSizov

To address the issue of consistency, it might help to make the presets/size flags buttons also reflect the selected nodes' current values (by making them toggle buttons, part of a button group)?

And in case of differing values between selected nodes, or when one isn't using a preset, none of the options would be highlighted.

And to be clear, if this is otherwise approved, I'm not going to die on that hill. πŸ™ƒ If this feels better, then it's better.

I'll gladly help working towards a solution everyone's happy with! So far, every change to the UI system was an improvement to the previous iteration, so I'm confident we'll get there, hopefully before 4.0 releases. πŸ™‚

RedMser avatar Sep 02 '22 18:09 RedMser

To address the issue of consistency, it might help to make the presets/size flags buttons also reflect the selected nodes' current values (by making them toggle buttons, part of a button group)?

We can give it a try.

Would also be nice to somehow indicate that "expand" is not a standalone flag and is changing the main flag's behavior. Maybe with a highlight like I did for the movie writer button (though that may be too much).

YuriSizov avatar Sep 02 '22 18:09 YuriSizov

It is exactly what I was expecting, the buttons and checkboxes to behave. in the issue #81726. Internally it has to be managed by code.

tokengamedev avatar Sep 18 '23 12:09 tokengamedev

Consistency aside, IMO the main problem with this change is that the state of the button is kind of undetermined. It's obvious when you select one Control, but if you have multiple selected controls or non-Control nodes mixed in it becomes messy.

Another option to consider, not mentioned here, is making the expand flag use a modifier key. So the checkbox could be replaced with a label "Hold Shift to set with Expand" (though it's long).

If not, at least the checkbox could be changed to CheckButton, to better convey immediate action.

KoBeWi avatar Apr 25 '24 19:04 KoBeWi

Consistency aside, IMO the main problem with this change is that the state of the button is kind of undetermined. It's obvious when you select one Control, but if you have multiple selected controls or non-Control nodes mixed in it becomes messy.

This is not a real problem as this is already the case in the Inspector and I'm assuming this is just doing the same as the Inspector which just chooses a value. I feel like this is okay as this how most things work in those case. Capture d’écran 2024-04-26 aΜ€ 03 30 49

If not, at least the checkbox could be changed to CheckButton, to better convey immediate action.

I agree check button would be better here

ajreckof avatar Apr 26 '24 01:04 ajreckof

Sorry it took me a while. Updated to use a check button, since I think this UX is clearer.

RedMser avatar May 09 '24 12:05 RedMser

Something is wrong with undo:

https://github.com/godotengine/godot/assets/2223172/6f1012db-9672-4dba-8003-bddf636aa8a3

KoBeWi avatar May 10 '24 09:05 KoBeWi

Something is wrong with undo:

Same bug existed for changing the shrink flags in that same popup as well. I fixed both by replacing _edit_set_state with the same set flags methods.

RedMser avatar May 10 '24 15:05 RedMser

Thanks!

akien-mga avatar May 11 '24 10:05 akien-mga