mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-22 10:43:57 -04:00
清理代码
This commit is contained in:
parent
c38371f454
commit
3a85ce8e1a
@ -64,11 +64,9 @@ public class ListPageSkin extends SkinBase<ListPage<?>> {
|
|||||||
vBox.setAlignment(Pos.BOTTOM_RIGHT);
|
vBox.setAlignment(Pos.BOTTOM_RIGHT);
|
||||||
vBox.setPickOnBounds(false);
|
vBox.setPickOnBounds(false);
|
||||||
|
|
||||||
JFXButton btnAdd = new JFXButton();
|
JFXButton btnAdd = FXUtils.newRaisedButton("");
|
||||||
FXUtils.setLimitWidth(btnAdd, 40);
|
FXUtils.setLimitWidth(btnAdd, 40);
|
||||||
FXUtils.setLimitHeight(btnAdd, 40);
|
FXUtils.setLimitHeight(btnAdd, 40);
|
||||||
btnAdd.getStyleClass().add("jfx-button-raised-round");
|
|
||||||
btnAdd.setButtonType(JFXButton.ButtonType.RAISED);
|
|
||||||
btnAdd.setGraphic(SVG.ADD.createIcon(Theme.whiteFill(), -1));
|
btnAdd.setGraphic(SVG.ADD.createIcon(Theme.whiteFill(), -1));
|
||||||
btnAdd.setOnAction(e -> skinnable.add());
|
btnAdd.setOnAction(e -> skinnable.add());
|
||||||
|
|
||||||
|
@ -82,8 +82,7 @@ public abstract class ModpackPage extends SpinnerPane implements WizardPage {
|
|||||||
|
|
||||||
BorderPane descriptionPane = new BorderPane();
|
BorderPane descriptionPane = new BorderPane();
|
||||||
{
|
{
|
||||||
btnDescription = new JFXButton(i18n("modpack.description"));
|
btnDescription = FXUtils.newBorderButton(i18n("modpack.description"));
|
||||||
btnDescription.getStyleClass().add("jfx-button-border");
|
|
||||||
btnDescription.setOnAction(e -> onDescribe());
|
btnDescription.setOnAction(e -> onDescribe());
|
||||||
descriptionPane.setLeft(btnDescription);
|
descriptionPane.setLeft(btnDescription);
|
||||||
|
|
||||||
|
@ -162,9 +162,8 @@ public abstract class SettingsView extends StackPane {
|
|||||||
));
|
));
|
||||||
|
|
||||||
{
|
{
|
||||||
JFXButton cleanButton = new JFXButton(i18n("launcher.cache_directory.clean"));
|
JFXButton cleanButton = FXUtils.newBorderButton(i18n("launcher.cache_directory.clean"));
|
||||||
cleanButton.setOnAction(e -> clearCacheDirectory());
|
cleanButton.setOnAction(e -> clearCacheDirectory());
|
||||||
cleanButton.getStyleClass().add("jfx-button-border");
|
|
||||||
|
|
||||||
fileCommonLocationSublist.setHeaderRight(cleanButton);
|
fileCommonLocationSublist.setHeaderRight(cleanButton);
|
||||||
}
|
}
|
||||||
@ -216,9 +215,8 @@ public abstract class SettingsView extends StackPane {
|
|||||||
if (LOG.getLogFile() == null)
|
if (LOG.getLogFile() == null)
|
||||||
openLogFolderButton.setDisable(true);
|
openLogFolderButton.setDisable(true);
|
||||||
|
|
||||||
JFXButton logButton = new JFXButton(i18n("settings.launcher.launcher_log.export"));
|
JFXButton logButton = FXUtils.newBorderButton(i18n("settings.launcher.launcher_log.export"));
|
||||||
logButton.setOnAction(e -> onExportLogs());
|
logButton.setOnAction(e -> onExportLogs());
|
||||||
logButton.getStyleClass().add("jfx-button-border");
|
|
||||||
|
|
||||||
HBox buttonBox = new HBox();
|
HBox buttonBox = new HBox();
|
||||||
buttonBox.setSpacing(10);
|
buttonBox.setSpacing(10);
|
||||||
|
@ -27,6 +27,7 @@ import javafx.scene.layout.HBox;
|
|||||||
import org.jackhuang.hmcl.task.Schedulers;
|
import org.jackhuang.hmcl.task.Schedulers;
|
||||||
import org.jackhuang.hmcl.task.Task;
|
import org.jackhuang.hmcl.task.Task;
|
||||||
import org.jackhuang.hmcl.ui.Controllers;
|
import org.jackhuang.hmcl.ui.Controllers;
|
||||||
|
import org.jackhuang.hmcl.ui.FXUtils;
|
||||||
import org.jackhuang.hmcl.ui.construct.MessageDialogPane;
|
import org.jackhuang.hmcl.ui.construct.MessageDialogPane;
|
||||||
import org.jackhuang.hmcl.ui.construct.PageCloseEvent;
|
import org.jackhuang.hmcl.ui.construct.PageCloseEvent;
|
||||||
import org.jackhuang.hmcl.ui.construct.SpinnerPane;
|
import org.jackhuang.hmcl.ui.construct.SpinnerPane;
|
||||||
@ -68,9 +69,7 @@ public final class NBTEditorPage extends SpinnerPane implements DecoratorPage {
|
|||||||
actions.setPadding(new Insets(8));
|
actions.setPadding(new Insets(8));
|
||||||
actions.setAlignment(Pos.CENTER_RIGHT);
|
actions.setAlignment(Pos.CENTER_RIGHT);
|
||||||
|
|
||||||
JFXButton saveButton = new JFXButton(i18n("button.save"));
|
JFXButton saveButton = FXUtils.newRaisedButton(i18n("button.save"));
|
||||||
saveButton.getStyleClass().add("jfx-button-raised");
|
|
||||||
saveButton.setButtonType(JFXButton.ButtonType.RAISED);
|
|
||||||
saveButton.setOnAction(e -> {
|
saveButton.setOnAction(e -> {
|
||||||
try {
|
try {
|
||||||
save();
|
save();
|
||||||
@ -80,9 +79,7 @@ public final class NBTEditorPage extends SpinnerPane implements DecoratorPage {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JFXButton cancelButton = new JFXButton(i18n("button.cancel"));
|
JFXButton cancelButton = FXUtils.newRaisedButton(i18n("button.cancel"));
|
||||||
cancelButton.getStyleClass().add("jfx-button-raised");
|
|
||||||
cancelButton.setButtonType(JFXButton.ButtonType.RAISED);
|
|
||||||
cancelButton.setOnAction(e -> fireEvent(new PageCloseEvent()));
|
cancelButton.setOnAction(e -> fireEvent(new PageCloseEvent()));
|
||||||
onEscPressed(this, cancelButton::fire);
|
onEscPressed(this, cancelButton::fire);
|
||||||
|
|
||||||
|
@ -198,7 +198,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
|
|||||||
copyGlobalPane.setLeft(label);
|
copyGlobalPane.setLeft(label);
|
||||||
BorderPane.setAlignment(label, Pos.CENTER_LEFT);
|
BorderPane.setAlignment(label, Pos.CENTER_LEFT);
|
||||||
|
|
||||||
JFXButton copyAll = new JFXButton(i18n("settings.game.copy_global.copy_all"));
|
JFXButton copyAll = FXUtils.newBorderButton(i18n("settings.game.copy_global.copy_all"));
|
||||||
copyAll.disableProperty().bind(modpack);
|
copyAll.disableProperty().bind(modpack);
|
||||||
copyGlobalPane.setRight(copyAll);
|
copyGlobalPane.setRight(copyAll);
|
||||||
copyAll.setOnAction(e -> Controllers.confirm(i18n("settings.game.copy_global.copy_all.confirm"), null, () -> {
|
copyAll.setOnAction(e -> Controllers.confirm(i18n("settings.game.copy_global.copy_all.confirm"), null, () -> {
|
||||||
@ -209,7 +209,6 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
|
|||||||
|
|
||||||
PropertyUtils.copyProperties(profile.getGlobal(), lastVersionSetting, name -> !ignored.contains(name));
|
PropertyUtils.copyProperties(profile.getGlobal(), lastVersionSetting, name -> !ignored.contains(name));
|
||||||
}, null));
|
}, null));
|
||||||
copyAll.getStyleClass().add("jfx-button-border");
|
|
||||||
BorderPane.setAlignment(copyAll, Pos.CENTER_RIGHT);
|
BorderPane.setAlignment(copyAll, Pos.CENTER_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -456,7 +455,7 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
|
|||||||
showAdvancedSettingPane.setLeft(label);
|
showAdvancedSettingPane.setLeft(label);
|
||||||
BorderPane.setAlignment(label, Pos.CENTER_LEFT);
|
BorderPane.setAlignment(label, Pos.CENTER_LEFT);
|
||||||
|
|
||||||
JFXButton button = new JFXButton(i18n("settings.advanced.modify"));
|
JFXButton button = FXUtils.newBorderButton(i18n("settings.advanced.modify"));
|
||||||
button.setOnAction(e -> {
|
button.setOnAction(e -> {
|
||||||
if (lastVersionSetting != null) {
|
if (lastVersionSetting != null) {
|
||||||
if (advancedVersionSettingPage == null)
|
if (advancedVersionSettingPage == null)
|
||||||
@ -465,7 +464,6 @@ public final class VersionSettingsPage extends StackPane implements DecoratorPag
|
|||||||
Controllers.navigate(advancedVersionSettingPage);
|
Controllers.navigate(advancedVersionSettingPage);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
button.getStyleClass().add("jfx-button-border");
|
|
||||||
showAdvancedSettingPane.setRight(button);
|
showAdvancedSettingPane.setRight(button);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user