Skip to content

Apply right to left mode after every layout build#12276

Merged
niksedk merged 1 commit into
SubtitleEdit:mainfrom
muaz978:fix/rtl-apply-after-layout-build
Jul 8, 2026
Merged

Apply right to left mode after every layout build#12276
niksedk merged 1 commit into
SubtitleEdit:mainfrom
muaz978:fix/rtl-apply-after-layout-build

Conversation

@muaz978

@muaz978 muaz978 commented Jul 8, 2026

Copy link
Copy Markdown

Follow up to #12256 (the commit was pushed shortly after the merge, so it needs its own PR). Completes the right to left work from issue #12249.

Problem

The window level right to left pass runs when the window opens, but the main layout is built later (posted to the dispatcher after the view attaches). Starting the app with right to left mode already enabled therefore walked a tree that did not yet contain the subtitle grid or the text boxes: the layout came up left to right, and only looked correct in sessions where the mode was toggled by hand afterwards. Switching layouts (View menu) had the same effect, since the rebuilt controls start left to right.

Fix

Re-apply the right to left pass after every layout build: the deferred startup build, a layout switch, and the undocked video layout rebuild. All three call the existing helper, which is idempotent (the edit grid mirror tracks its state through its Tag, text directions are recomputed from content), so repeated application is safe. Left to right mode is unaffected; the calls are guarded by the setting.

Testing

Verified on macOS (Apple Silicon): with right to left mode persisted from the previous session, the app now starts mirrored with no toggle needed, opening an original on top keeps the arrangement, and layout switching in right to left mode keeps the mirror. The four language arrangement screenshots on #12256 were taken with this commit included.

The window level right to left pass runs when the window opens, but the main
layout is built later (posted to the dispatcher after the view attaches), so
starting the app with right to left mode enabled walked a tree that did not
contain the subtitle grid or the text boxes yet: the layout came up left to
right and only looked correct in sessions where the mode was toggled by hand
afterwards. Switching layouts had the same effect, since the rebuilt controls
start left to right.

The pass is now re-applied right after the deferred startup layout build,
after a layout switch, and after the undocked video layout rebuild. All three
call the same helper, and the pass is idempotent (the grid mirror tracks its
state, directions are recomputed from content), so repeated application is
safe.
@niksedk niksedk merged commit f5d4ed7 into SubtitleEdit:main Jul 8, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants