From adc5b08765527f1f9c7999945e19b6303ad05d12 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Mon, 9 Jul 2018 14:04:30 +0800 Subject: [PATCH 1/4] Fix account page overflow --- HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java | 1 - 1 file changed, 1 deletion(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java index 10e2f1979..d5778431d 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java @@ -78,7 +78,6 @@ public class AccountPage extends StackPane implements DecoratorPage { FXUtils.loadFXML(this, "/assets/fxml/account.fxml"); - FXUtils.setLimitWidth(this, 300); if (account instanceof AuthlibInjectorAccount) { lblServer.setText(((AuthlibInjectorAccount) account).getServer().getName()); FXUtils.setLimitHeight(this, 182); From 6b5302907ac174fa22249952523ce8c3b2358a4b Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Mon, 9 Jul 2018 14:08:55 +0800 Subject: [PATCH 2/4] [AccountPage]Display auth server url in tooltip of auth server name --- .../main/java/org/jackhuang/hmcl/ui/AccountPage.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java index d5778431d..482dc5ef4 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java @@ -31,6 +31,7 @@ import javafx.scene.layout.StackPane; import org.jackhuang.hmcl.auth.Account; import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorAccount; +import org.jackhuang.hmcl.auth.authlibinjector.AuthlibInjectorServer; import org.jackhuang.hmcl.auth.offline.OfflineAccount; import org.jackhuang.hmcl.auth.yggdrasil.YggdrasilAccount; import org.jackhuang.hmcl.game.AccountHelper; @@ -39,6 +40,8 @@ import org.jackhuang.hmcl.setting.Theme; import org.jackhuang.hmcl.task.Schedulers; import org.jackhuang.hmcl.ui.construct.ComponentList; import org.jackhuang.hmcl.ui.wizard.DecoratorPage; + +import static org.jackhuang.hmcl.ui.FXUtils.installTooltip; import static org.jackhuang.hmcl.util.i18n.I18n.i18n; import java.util.Optional; @@ -79,7 +82,9 @@ public class AccountPage extends StackPane implements DecoratorPage { FXUtils.loadFXML(this, "/assets/fxml/account.fxml"); if (account instanceof AuthlibInjectorAccount) { - lblServer.setText(((AuthlibInjectorAccount) account).getServer().getName()); + AuthlibInjectorServer server = ((AuthlibInjectorAccount) account).getServer(); + lblServer.setText(server.getName()); + installTooltip(lblServer, server.getUrl()); FXUtils.setLimitHeight(this, 182); } else { componentList.removeChildren(paneServer); @@ -87,8 +92,9 @@ public class AccountPage extends StackPane implements DecoratorPage { if (account instanceof OfflineAccount) { componentList.removeChildren(paneEmail); FXUtils.setLimitHeight(this, 110); - } else + } else { FXUtils.setLimitHeight(this, 145); + } } btnDelete.setGraphic(SVG.delete(Theme.blackFillBinding(), 15, 15)); From 094249a6fa61074181d9d54f0db058db4367f5ff Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Mon, 9 Jul 2018 14:31:41 +0800 Subject: [PATCH 3/4] Set margin of fields in AccountPage --- HMCL/src/main/resources/assets/fxml/account.fxml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/HMCL/src/main/resources/assets/fxml/account.fxml b/HMCL/src/main/resources/assets/fxml/account.fxml index 98666ef13..acf7202df 100644 --- a/HMCL/src/main/resources/assets/fxml/account.fxml +++ b/HMCL/src/main/resources/assets/fxml/account.fxml @@ -2,6 +2,7 @@ + @@ -20,6 +21,9 @@ + + + @@ -33,6 +37,9 @@ + + + @@ -46,6 +53,9 @@ + + + @@ -59,6 +69,9 @@ + + + From 09470eeb8aadb0a9b134e1969af7f28074d16d29 Mon Sep 17 00:00:00 2001 From: yushijinhun Date: Mon, 9 Jul 2018 14:35:30 +0800 Subject: [PATCH 4/4] Use auto layout instead of manual sizing --- .../org/jackhuang/hmcl/ui/AccountPage.java | 4 --- .../main/resources/assets/fxml/account.fxml | 25 +++++++++---------- 2 files changed, 12 insertions(+), 17 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java index 482dc5ef4..16052ebee 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/AccountPage.java @@ -85,15 +85,11 @@ public class AccountPage extends StackPane implements DecoratorPage { AuthlibInjectorServer server = ((AuthlibInjectorAccount) account).getServer(); lblServer.setText(server.getName()); installTooltip(lblServer, server.getUrl()); - FXUtils.setLimitHeight(this, 182); } else { componentList.removeChildren(paneServer); if (account instanceof OfflineAccount) { componentList.removeChildren(paneEmail); - FXUtils.setLimitHeight(this, 110); - } else { - FXUtils.setLimitHeight(this, 145); } } diff --git a/HMCL/src/main/resources/assets/fxml/account.fxml b/HMCL/src/main/resources/assets/fxml/account.fxml index acf7202df..392473a58 100644 --- a/HMCL/src/main/resources/assets/fxml/account.fxml +++ b/HMCL/src/main/resources/assets/fxml/account.fxml @@ -77,19 +77,18 @@ - + + + + + + + + - - - - - - - -