mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-16 15:26:27 -04:00
Profile page title changed to display name
This commit is contained in:
parent
a72d27a431
commit
17d1af181d
@ -487,6 +487,7 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
|
||||
}
|
||||
|
||||
private void setContent(Node content, AnimationProducer animation) {
|
||||
isWizardPageNow = false;
|
||||
animationHandler.setContent(content, animation);
|
||||
|
||||
if (content instanceof Region) {
|
||||
@ -510,6 +511,7 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
|
||||
|
||||
private String category;
|
||||
private Node nowPage;
|
||||
private boolean isWizardPageNow;
|
||||
|
||||
public Node getNowPage() {
|
||||
return nowPage;
|
||||
@ -573,6 +575,7 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
|
||||
contentPlaceHolder.getStyleClass().removeAll("gray-background", "white-background");
|
||||
contentPlaceHolder.getStyleClass().add("white-background");
|
||||
setContent(page, nav.getAnimation().getAnimationProducer());
|
||||
isWizardPageNow = true;
|
||||
}
|
||||
|
||||
@FXML
|
||||
@ -588,7 +591,7 @@ public final class Decorator extends StackPane implements TaskExecutorDialogWiza
|
||||
|
||||
@FXML
|
||||
private void onBack() {
|
||||
if (wizardController.canPrev())
|
||||
if (isWizardPageNow && wizardController.canPrev())
|
||||
wizardController.onPrev(true);
|
||||
else
|
||||
onCloseNav();
|
||||
|
@ -51,15 +51,16 @@ public final class ProfilePage extends StackPane implements DecoratorPage {
|
||||
*/
|
||||
public ProfilePage(Profile profile) {
|
||||
this.profile = profile;
|
||||
String profileDisplayName = Optional.ofNullable(profile).map(Profiles::getProfileDisplayName).orElse("");
|
||||
|
||||
title = new SimpleStringProperty(this, "title",
|
||||
profile == null ? Main.i18n("profile.new") : Main.i18n("profile") + " - " + profile.getName());
|
||||
profile == null ? Main.i18n("profile.new") : Main.i18n("profile") + " - " + profileDisplayName);
|
||||
location = new SimpleStringProperty(this, "location",
|
||||
Optional.ofNullable(profile).map(Profile::getGameDir).map(File::getAbsolutePath).orElse(""));
|
||||
|
||||
FXUtils.loadFXML(this, "/assets/fxml/profile.fxml");
|
||||
|
||||
txtProfileName.setText(Optional.ofNullable(profile).map(Profiles::getProfileDisplayName).orElse(""));
|
||||
txtProfileName.setText(profileDisplayName);
|
||||
FXUtils.onChangeAndOperate(txtProfileName.textProperty(), it -> {
|
||||
btnSave.setDisable(!txtProfileName.validate() || StringUtils.isBlank(getLocation()));
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user