diff --git a/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkTitlePane.java b/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkTitlePane.java index 8b0416ae..17fa2eb2 100644 --- a/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkTitlePane.java +++ b/src/main/java/com/github/weisj/darklaf/ui/rootpane/DarkTitlePane.java @@ -676,46 +676,63 @@ public class DarkTitlePane extends JComponent { int left = 0; int right = 0; - if (leftToRight) { - if (windowIconButton != null) { - windowIconButton.setBounds(start, y, ICON_WIDTH, height); - start += ICON_WIDTH + PAD; - left = start; - } - if (menuBar != null) { - int menuWidth = getPreferredMenuSize().width; - Insets menuInsets = menuBar.getInsets(); - menuBar.setBounds(start, y, menuWidth, height + menuInsets.bottom); - start += menuWidth + PAD; - left += menuWidth; - } - x = w; - if (closeButton != null) { - x -= BUTTON_WIDTH; - right += BUTTON_WIDTH; - closeButton.setBounds(x, y, BUTTON_WIDTH, height); - } - if (getWindowDecorationStyle() == JRootPane.FRAME) { - if (Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) { - if (minimizeButton != null && maximizeToggleButton.getParent() != null) { - x -= BUTTON_WIDTH; - right += BUTTON_WIDTH; - maximizeToggleButton.setBounds(x, y, BUTTON_WIDTH, height); - } - if (minimizeButton != null && minimizeButton.getParent() != null) { - x -= BUTTON_WIDTH; - right += BUTTON_WIDTH; - minimizeButton.setBounds(x, y, BUTTON_WIDTH, height); - } + if (windowIconButton != null) { + windowIconButton.setBounds(start, y, ICON_WIDTH, height); + start += ICON_WIDTH + PAD; + left = start; + } + if (menuBar != null) { + int menuWidth = getPreferredMenuSize().width; + Insets menuInsets = menuBar.getInsets(); + menuBar.setBounds(start, y, menuWidth, height + menuInsets.bottom); + start += menuWidth + PAD; + left += menuWidth; + } + x = w; + if (closeButton != null) { + x -= BUTTON_WIDTH; + right += BUTTON_WIDTH; + closeButton.setBounds(x, y, BUTTON_WIDTH, height); + } + if (getWindowDecorationStyle() == JRootPane.FRAME) { + if (Toolkit.getDefaultToolkit().isFrameStateSupported(Frame.MAXIMIZED_BOTH)) { + if (maximizeToggleButton != null && maximizeToggleButton.getParent() != null) { + x -= BUTTON_WIDTH; + right += BUTTON_WIDTH; + maximizeToggleButton.setBounds(x, y, BUTTON_WIDTH, height); + } + if (minimizeButton != null && minimizeButton.getParent() != null) { + x -= BUTTON_WIDTH; + right += BUTTON_WIDTH; + minimizeButton.setBounds(x, y, BUTTON_WIDTH, height); } } - start = Math.max(start, PAD); - titleLabel.setBounds(start, 0, x - start - PAD, height); - JNIDecorations.updateValues(windowHandle, Scale.scaleWidth(left), - Scale.scaleWidth(right), - Scale.scaleHeight(height)); - } else { - //Todo. + } + start = Math.max(start, PAD); + titleLabel.setBounds(start, 0, x - start - PAD, height); + + if (!leftToRight) { + mirror(windowIconButton, w); + mirror(menuBar, w); + mirror(closeButton, w); + mirror(minimizeButton, w); + mirror(maximizeToggleButton, w); + mirror(titleLabel, w); + int tmp = left; + left = right; + right = tmp; + + } + JNIDecorations.updateValues(windowHandle, Scale.scaleWidth(left), + Scale.scaleWidth(right), + Scale.scaleHeight(height)); + + } + + private void mirror(final JComponent component, final int w) { + if (component != null) { + component.setLocation(w - component.getX() - component.getWidth(), + component.getY()); } } diff --git a/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_defaults.properties b/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_defaults.properties index f559663a..a6f37dd3 100644 --- a/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_defaults.properties +++ b/src/main/resources/com/github/weisj/darklaf/theme/darcula/darcula_defaults.properties @@ -118,7 +118,6 @@ %hyperlink = 589df6 ####Misc#### -#Todo Line Colors %shadow = 000000 %glowFocus = 3e84c9 %glowFocusLine = 466D94