Skip to content

Mirror layout for RTL languages - #1180

Merged
fracturehill merged 2 commits into
mainfrom
work/rtllayout
Oct 20, 2026
Merged

fracturehill merged 2 commits into
mainfrom
work/rtllayout

Conversation

@fracturehill

Copy link
Copy Markdown
Contributor

Most of the layout was previously broken for languages that read right to left. This commit:

  • Sets the LayoutMirroring.enabled and .childrenInherit properties for all top-level qml files that need it;
  • Sets explicit left alignment for Labels that were missing it. The mirroring will convert those to right-aligned on locales that need it, instead of relying on text content to pick alignment;
  • Works around a (presumable) Qt bug where context menu items don't inherit the mirroring by making a custom MenuItem component;
  • For items that add padding for a scrollbar, the padding will move left on an RTL locale, since the scrollbar moves as well. As a drive-by, the padding's size is now dependent on the effectiveScrollBarWidth property, which gives the real on-screen size of the scrollbar.
image

Fixes: #668

@fracturehill
fracturehill force-pushed the work/rtllayout branch 2 times, most recently from 460aa1b to 419d555 Compare October 16, 2026 11:37
Most of the layout was previously broken for languages that read
right to left. This commit:

- Sets the LayoutMirroring.enabled and .childrenInherit properties
for all top-level qml files that need it;
- Sets explicit left alignment for Labels that were missing it.
The mirroring will convert those to right-aligned on locales that
need it, instead of relying on text content to pick alignment;
- Works around a (presumable) Qt bug where context menu items don't
inherit the mirroring by making a custom MenuItem component;
- For items that add padding for a scrollbar, the padding will
move left on an RTL locale, since the scrollbar moves as well. As a
drive-by, the padding's size is now dependent on the
effectiveScrollBarWidth property, which gives the real on-screen size
of the scrollbar.
@fracturehill
fracturehill merged commit 203ebf1 into main Oct 20, 2026
@fracturehill
fracturehill deleted the work/rtllayout branch October 20, 2026 12:25
@openclouders openclouders mentioned this pull request Oct 20, 2026
1 task
@saw-jan saw-jan mentioned this pull request Nov 25, 2026
9 of 22 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

QML code is not LTR aware

2 participants