Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/DialogPane.java

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

要改布局就不要复用 DialogPane 了,直接使用 JFXDialogLayout 就好了。

Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ public class DialogPane extends JFXDialogLayout {
private final JFXProgressBar progressBar = new JFXProgressBar();

public DialogPane() {
this(false);
}

public DialogPane(boolean closeOnly) {
Label titleLabel = new Label();
titleLabel.textProperty().bind(title);
setHeading(titleLabel);
Expand All @@ -58,12 +62,17 @@ public DialogPane() {
acceptPane.getStyleClass().add("small-spinner-pane");
acceptPane.setContent(acceptButton);

cancelButton.setText(i18n("button.cancel"));
cancelButton.setText(closeOnly ? i18n("button.close") : i18n("button.cancel"));
cancelButton.setOnAction(e -> onCancel());
cancelButton.getStyleClass().add("dialog-cancel");
onEscPressed(this, cancelButton::fire);

setActions(warningLabel, acceptPane, cancelButton);
if (closeOnly) {
setActions(warningLabel, cancelButton);
} else {
setActions(warningLabel, acceptPane, cancelButton);
}

}

protected JFXProgressBar getProgressBar() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public class GameInstanceIconDialog extends DialogPane {
private final GameSettings.@Nullable Instance setting;

public GameInstanceIconDialog(HMCLGameInstance gameInstance, Runnable onFinish) {
super(true);

this.gameInstance = gameInstance;
this.onFinish = onFinish;
this.setting = gameInstance.getSettingsOrCreate();
Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N.properties
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ assets.index.malformed=Index files of downloaded assets are corrupted. You can r
button.cancel=Cancel
button.change_source=Change Download Source
button.clear=Clear
button.close=Close
button.copy=Copy
button.copy_and_exit=Copy and Exit
button.delete=Delete
Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh.properties
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ assets.index.malformed=資源檔案的索引檔案損壞。你可以在相應實
button.cancel=取消
button.change_source=切換下載源
button.clear=清除
button.close=關閉
button.copy=複製
button.copy_and_exit=複製並退出
button.delete=刪除
Expand Down
1 change: 1 addition & 0 deletions HMCL/src/main/resources/assets/lang/I18N_zh_CN.properties
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,7 @@ assets.index.malformed=资源文件的索引文件损坏。你可以在相应实
button.cancel=取消
button.change_source=切换下载源
button.clear=清除
button.close=关闭
button.copy=复制
button.copy_and_exit=复制并退出
button.delete=删除
Expand Down