-
-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Implement vertical icon alignment for buttons #74369
Conversation
Needs rebase. |
@KoBeWi Done |
@@ -58,7 +58,7 @@ | |||
To edit margin and spacing of the icon, use [theme_item h_separation] theme property and [code]content_margin_*[/code] properties of the used [StyleBox]es. | |||
</member> | |||
<member name="icon_alignment" type="int" setter="set_icon_alignment" getter="get_icon_alignment" enum="HorizontalAlignment" default="0"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess a better name is horizontal_icon_alignment
, but to keep backwards compatibility it is better to not touch it.
Still maybe an idea in the future.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. And a nice addition which I needed several times already. :)
Thanks! |
What is the expected behavior of those When |
Buttons already support aligning the icon to the left/right of the text. However this is a bit limiting, as it may also be desired to have the text above/below the icon.
This PR therefore adds the option to align the icon vertically by adding a
vertical_icon_alignment
property to the button class.Here is an example image showing all combinations:
Here's the same image with
expand_icon
turned on:Feel free to test the button behavior on my test project:
vertical_button_test.zip