Skip to content

Commit

Permalink
修复界面恢复后label无法正常显示名字
Browse files Browse the repository at this point in the history
  • Loading branch information
lensferno committed Mar 17, 2022
1 parent 58d2dbb commit 314cd5b
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,7 @@ void miniMode(ActionEvent event) {
miniPaneController.setCurrentScene(miniScene);

miniPaneController.setListeners();
miniPaneController.setOldTextProperties(upperLabel.textProperty(), downLabel.textProperty());

miniStage.show();
currentStage.hide();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@ public void setBase(Data data, Selector selector) {
this.selector.setLabelTexts(chosenNameLabel.textProperty());
}

public void setOldTextProperties(StringProperty ...stringProperty) {
this.oldTextProperties = stringProperty;
}

@FXML
void recoverMode(ActionEvent event) {
// todo: 待修复:界面恢复后label无法正常显示名字
this.oldStage.setOnShown((e) -> selector.setLabelTexts(oldTextProperties));
this.oldStage.show();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,7 @@ public boolean isWorkerRunning() {
}

public void setNumberRange() {
int minNumber = Integer.parseInt(GlobalConfig.mainConfig.getMinNumber());
int maxNumber = Integer.parseInt(GlobalConfig.mainConfig.getMaxNumber());
coreWorker.setNumberRange(minNumber, maxNumber);
coreWorker.setNumberRange();
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ public SimpleBooleanProperty stoppedIndicatorProperty() {
return stoppedIndicator;
}

public void setNumberRange(int minNumber, int maxNumber) {
this.numberRange[MIN_NUMBER] = minNumber;
this.numberRange[MAX_NUMBER] = maxNumber;
public void setNumberRange() {
this.numberRange[MIN_NUMBER] = Integer.parseInt(GlobalConfig.mainConfig.getMinNumber());
this.numberRange[MAX_NUMBER] = Integer.parseInt(GlobalConfig.mainConfig.getMaxNumber());
}

public void setForceStop(boolean forceStop) {
Expand Down

0 comments on commit 314cd5b

Please sign in to comment.