Current account tip

This commit is contained in:
huangyuhui 2018-02-14 00:19:25 +08:00
parent 0fb248e6be
commit f850c2461a
4 changed files with 10 additions and 2 deletions

View File

@ -56,6 +56,7 @@ public final class AccountItem extends StackPane {
@FXML private Label lblUser; @FXML private Label lblUser;
@FXML private Label lblType; @FXML private Label lblType;
@FXML private Label lblEmail; @FXML private Label lblEmail;
@FXML private Label lblCurrentAccount;
@FXML private JFXRadioButton chkSelected; @FXML private JFXRadioButton chkSelected;
@FXML private JFXProgressBar pgsSkin; @FXML private JFXProgressBar pgsSkin;
@FXML private ImageView portraitView; @FXML private ImageView portraitView;
@ -83,7 +84,8 @@ public final class AccountItem extends StackPane {
icon.translateYProperty().bind(Bindings.createDoubleBinding(() -> header.getBoundsInParent().getHeight() - icon.getHeight() / 2 - 32.0, header.boundsInParentProperty(), icon.heightProperty())); icon.translateYProperty().bind(Bindings.createDoubleBinding(() -> header.getBoundsInParent().getHeight() - icon.getHeight() / 2 - 32.0, header.boundsInParentProperty(), icon.heightProperty()));
chkSelected.getProperties().put("account", account); chkSelected.getProperties().put("account", account);
chkSelected.setSelected(Settings.INSTANCE.getSelectedAccount() == account); setSelected(Settings.INSTANCE.getSelectedAccount() == account);
lblUser.setText(Accounts.getCurrentCharacter(account)); lblUser.setText(Accounts.getCurrentCharacter(account));
lblType.setText(AccountsPage.accountType(account)); lblType.setText(AccountsPage.accountType(account));
lblEmail.setText(account.getUsername()); lblEmail.setText(account.getUsername());
@ -138,6 +140,7 @@ public final class AccountItem extends StackPane {
} }
public void setSelected(boolean selected) { public void setSelected(boolean selected) {
lblCurrentAccount.setVisible(selected);
chkSelected.setSelected(selected); chkSelected.setSelected(selected);
} }

View File

@ -37,7 +37,10 @@
</HBox> </HBox>
</left> </left>
<right> <right>
<HBox alignment="CENTER_RIGHT">
<Label fx:id="lblCurrentAccount" text="%account.current" />
<JFXRadioButton fx:id="chkSelected" BorderPane.alignment="CENTER_RIGHT" /> <JFXRadioButton fx:id="chkSelected" BorderPane.alignment="CENTER_RIGHT" />
</HBox>
</right> </right>
</BorderPane> </BorderPane>

View File

@ -30,6 +30,7 @@ about.open_source.statement=GPL v3 (https://github.com/huanghongxun/HMCL/)
account=Accounts account=Accounts
account.choose=Choose a character account.choose=Choose a character
account.current=Current account
account.create=Create a new account account.create=Create a new account
account.email=Email account.email=Email
account.failed.connect_authentication_server=Cannot connect the authentication server. Check your network. account.failed.connect_authentication_server=Cannot connect the authentication server. Check your network.

View File

@ -30,6 +30,7 @@ about.open_source.statement=GPL v3 (https://github.com/huanghongxun/HMCL/)
account=账户 account=账户
account.choose=选择一个角色 account.choose=选择一个角色
account.current=当前账户
account.create=新建账户 account.create=新建账户
account.email=邮箱 account.email=邮箱
account.failed.connect_authentication_server=无法连接认证服务器,可能是网络问题 account.failed.connect_authentication_server=无法连接认证服务器,可能是网络问题