X Tutup
Skip to content

Fix LineEdit icon position in right-to-left layout#109363

Merged
Repiteo merged 1 commit intogodotengine:masterfrom
Giganzo:line_edit_rtl_icon
Sep 16, 2025
Merged

Fix LineEdit icon position in right-to-left layout#109363
Repiteo merged 1 commit intogodotengine:masterfrom
Giganzo:line_edit_rtl_icon

Conversation

@Giganzo
Copy link
Contributor

@Giganzo Giganzo commented Aug 6, 2025

This PR is made to move the icon (clear and custom) to the left side when layout direction is set to right-to-left (rtl), as mentioned here #109329 (comment).

Only Left and Right alignment is changed to work correctly with this new icon placement. For Center alignment it might be better to either wait for PR #109329 to get merged and update this PR after, or to come back and fix it in a follow up pr after both is merged. Should work for all alignments.

Would need some help to test so things works as they should, thanks!

You can use this project to test with, use control (2) scene for rigth_to_left layout:
line-edit-center-align.zip

Stylebox problem

This is not part of this PR but this is probably good to change in the future.

The stylebox for the LineEdit is not correct when drawn for rtl layout if you have different left and right margins/borders.

Button is using "state"_mirrored styleboxes that users can setup to solve this. So either we need to add this for the LineEdit.

Or would it be possible to make styleboxes be able to be drawn flipped horizontally? To limit the number of styleboxes.

@Giganzo Giganzo requested a review from a team as a code owner August 6, 2025 16:16
@bruvzg bruvzg self-requested a review August 6, 2025 16:18
@AThousandShips AThousandShips added this to the 4.6 milestone Aug 6, 2025
@AThousandShips AThousandShips added cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release labels Aug 6, 2025
@Giganzo Giganzo force-pushed the line_edit_rtl_icon branch from f140eb9 to fbf27db Compare August 7, 2025 15:56
@Repiteo Repiteo merged commit ebb51d1 into godotengine:master Sep 16, 2025
20 checks passed
@Repiteo
Copy link
Contributor

Repiteo commented Sep 16, 2025

Thanks!

@Repiteo
Copy link
Contributor

Repiteo commented Sep 16, 2025

Cherry-picked to 4.5

@Repiteo Repiteo removed cherrypick:4.5 Considered for cherry-picking into a future 4.5.x release cherrypick:4.4 Considered for cherry-picking into a future 4.4.x release labels Sep 16, 2025
@akien-mga akien-mga changed the title Fix LineEdit icon positon in right-to-left layout Fix LineEdit icon position in right-to-left layout Jan 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

X Tutup