godot icon indicating copy to clipboard operation
godot copied to clipboard

Add extra padding to Revert button, to make it easier to hit

Open Giganzo opened this issue 1 year ago • 2 comments

A s discussed here: https://github.com/godotengine/godot-proposals/discussions/10265

This would add extra padding to the Revert button so it makes it easier to click.

You can see the difference here:

Screencast_20240725_115514.webm

With rtl == true the icon is not lining up exactly with previous placement. Is that needed, and if so do you have any recommendation?

Giganzo avatar Jul 25 '24 14:07 Giganzo

I did see EDSCALE (stands for editor scale?) is used on borders and such thing in the editor. Should that be applied here?

Yes, vertical_padding and horizontal_padding should be multiplied by EDSCALE when first assigned so that the padding becomes higher on hiDPI displays.

And should vertical and horizontal_padding be change to a Size2?

Size2 is equivalent to Vector2. It's used to denote a Vector2 being used to indicate a size, as opposed to a direction vector or similar.

Calinou avatar Jul 26 '24 21:07 Calinou

Yes, vertical_padding and horizontal_padding should be multiplied by EDSCALE when first assigned so that the padding becomes higher on hiDPI displays.

Added EDSCALE and some tweaks to icon positioning.


The reason why I did split up padding in vertical and horizontal was that my first idea was to base the vertical padding on the size of its parent container.

Doing somethin like this:

((size.height-reload_icon->get_height())/2) - (((size.height-reload_icon->get_height())/2) % 2)

I skipped that part, as it might be confusing(?) if there are any places where the parent container is bigger.

But it might solve another problem. Not to familiar with or editor theming works, but if its possible to change the height of properties in the inspector you might end up with overlapping revert buttons if padding is set to high.

Do you think this is possible and needs to be added?

If its a problem that it gets to big, you could do it like this:

min(6, ((size.height-reload_icon->get_height())/2) - (((size.height-reload_icon->get_height())/2) % 2)) * EDSCALE

Giganzo avatar Jul 27 '24 09:07 Giganzo

Superseded by #102681.

akien-mga avatar Feb 15 '25 15:02 akien-mga