macOS: Adding support for RTL Custom TitleBar#586
Open
kdroidFilter wants to merge 1 commit intoJetBrains:jbr25from
Open
macOS: Adding support for RTL Custom TitleBar#586kdroidFilter wants to merge 1 commit intoJetBrains:jbr25from
kdroidFilter wants to merge 1 commit intoJetBrains:jbr25from
Conversation
Read the `controls.rtl` property on macOS and mirror the traffic light buttons (close, miniaturize, zoom) to the right side of the title bar when enabled. This mirrors the Windows implementation from PR JetBrains#540. Changes: - Add internalCustomTitleBarControlsRtl() JNI accessor in Window.java - Add customTitleBarControlsRtl property to AWTWindow - Anchor buttons to rightAnchor with negative offsets when RTL - Swap left/right insets reporting when RTL - Position full-screen buttons on the right when RTL - Force full titlebar re-setup when RTL flag changes at runtime
Author
|
@faogustavo can you take a look? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR adds macOS support for the
controls.rtlproperty on the Custom TitleBar, aligning the macOS behavior with the Windows implementation introduced in #540.On Windows, PR #540 reads the
controls.rtlproperty and mirrors the native window control buttons to the right side. On macOS, the same property existed on the Java side but was never read — the traffic light buttons (close, miniaturize, zoom) were always anchored to the left via Auto Layout constraints. This PR fixes that.Solution
Following the same approach as #540 (adding an RTL flag as a titlebar property), this implementation:
controls.rtlproperty via a new JNI accessor (internalCustomTitleBarControlsRtl)rightAnchorwith negative offsets when RTL is enabled (instead ofleftAnchorwith positive offsets)Note
This solution is only applied to the custom titlebar implementation. Default/AWT window controls were not changed.
Changes
Window.javainternalCustomTitleBarControlsRtl()JNI convenience methodAWTWindow.hcustomTitleBarControlsRtlpropertyAWTWindow.mEvidences
controls.rtl = true)Tested with the Jewel standalone sample on JBR 25, macOS aarch64.