Use native window border on osx (workaround for #403)

This commit is contained in:
Shuanglei Tao
2018-08-05 23:10:17 +08:00
parent e57a1a8da6
commit b3e776b4bc
2 changed files with 11 additions and 2 deletions

View File

@@ -67,6 +67,8 @@ import org.jackhuang.hmcl.ui.construct.StackContainerPane;
import org.jackhuang.hmcl.ui.construct.TaskExecutorDialogWizardDisplayer; import org.jackhuang.hmcl.ui.construct.TaskExecutorDialogWizardDisplayer;
import org.jackhuang.hmcl.ui.wizard.*; import org.jackhuang.hmcl.ui.wizard.*;
import org.jackhuang.hmcl.util.Lang; import org.jackhuang.hmcl.util.Lang;
import org.jackhuang.hmcl.util.OperatingSystem;
import java.io.IOException; import java.io.IOException;
import java.nio.file.Files; import java.nio.file.Files;
import java.nio.file.Path; import java.nio.file.Path;
@@ -167,7 +169,14 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
onCloseButtonAction = new SimpleObjectProperty<>(this, "onCloseButtonAction", Launcher::stopApplication); onCloseButtonAction = new SimpleObjectProperty<>(this, "onCloseButtonAction", Launcher::stopApplication);
primaryStage.initStyle(StageStyle.UNDECORATED); switch (OperatingSystem.CURRENT_OS) {
case OSX:
titleContainer.setRight(null);
break;
default:
primaryStage.initStyle(StageStyle.UNDECORATED);
break;
}
btnClose.setGraphic(close); btnClose.setGraphic(close);
btnMin.setGraphic(minus); btnMin.setGraphic(minus);
btnMax.setGraphic(resizeMax); btnMax.setGraphic(resizeMax);

View File

@@ -91,7 +91,6 @@
<HBox fx:id="navRight" alignment="CENTER_LEFT"> <HBox fx:id="navRight" alignment="CENTER_LEFT">
<JFXButton fx:id="refreshNavButton" onMouseClicked="#onRefresh" <JFXButton fx:id="refreshNavButton" onMouseClicked="#onRefresh"
styleClass="jfx-decorator-button" ripplerFill="white" /> styleClass="jfx-decorator-button" ripplerFill="white" />
<Rectangle height="${navBar.height}" width="1" fill="gray"/>
</HBox> </HBox>
</right> </right>
</BorderPane> </BorderPane>
@@ -101,6 +100,7 @@
<padding> <padding>
<Insets topRightBottomLeft="4.0"/> <Insets topRightBottomLeft="4.0"/>
</padding> </padding>
<Rectangle height="${navBar.height}" width="1" fill="gray"/>
<JFXButton fx:id="btnMin" styleClass="jfx-decorator-button" ripplerFill="white" <JFXButton fx:id="btnMin" styleClass="jfx-decorator-button" ripplerFill="white"
onAction="#onMin"> onAction="#onMin">
</JFXButton> </JFXButton>