mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-19 08:46:09 -04:00
清理对 setOnMouseClicked 的误用 (#3379)
This commit is contained in:
parent
dcfcd1d8b2
commit
9e56b5cd15
@ -53,7 +53,7 @@ public class CrashWindow extends Stage {
|
|||||||
|
|
||||||
Button btnContact = new Button();
|
Button btnContact = new Button();
|
||||||
btnContact.setText(i18n("launcher.contact"));
|
btnContact.setText(i18n("launcher.contact"));
|
||||||
btnContact.setOnMouseClicked(event -> FXUtils.openLink(Metadata.CONTACT_URL));
|
btnContact.setOnAction(event -> FXUtils.openLink(Metadata.CONTACT_URL));
|
||||||
HBox box = new HBox();
|
HBox box = new HBox();
|
||||||
box.setStyle("-fx-padding: 8px;");
|
box.setStyle("-fx-padding: 8px;");
|
||||||
box.getChildren().add(btnContact);
|
box.getChildren().add(btnContact);
|
||||||
|
@ -417,10 +417,10 @@ public class GameCrashWindow extends Stage {
|
|||||||
HBox toolBar = new HBox();
|
HBox toolBar = new HBox();
|
||||||
{
|
{
|
||||||
JFXButton exportGameCrashInfoButton = FXUtils.newRaisedButton(i18n("logwindow.export_game_crash_logs"));
|
JFXButton exportGameCrashInfoButton = FXUtils.newRaisedButton(i18n("logwindow.export_game_crash_logs"));
|
||||||
exportGameCrashInfoButton.setOnMouseClicked(e -> exportGameCrashInfo());
|
exportGameCrashInfoButton.setOnAction(e -> exportGameCrashInfo());
|
||||||
|
|
||||||
JFXButton logButton = FXUtils.newRaisedButton(i18n("logwindow.title"));
|
JFXButton logButton = FXUtils.newRaisedButton(i18n("logwindow.title"));
|
||||||
logButton.setOnMouseClicked(e -> showLogWindow());
|
logButton.setOnAction(e -> showLogWindow());
|
||||||
|
|
||||||
JFXButton helpButton = FXUtils.newRaisedButton(i18n("help"));
|
JFXButton helpButton = FXUtils.newRaisedButton(i18n("help"));
|
||||||
helpButton.setOnAction(e -> FXUtils.openLink("https://docs.hmcl.net/help.html"));
|
helpButton.setOnAction(e -> FXUtils.openLink("https://docs.hmcl.net/help.html"));
|
||||||
|
@ -70,7 +70,7 @@ public class ListPageSkin extends SkinBase<ListPage<?>> {
|
|||||||
btnAdd.getStyleClass().add("jfx-button-raised-round");
|
btnAdd.getStyleClass().add("jfx-button-raised-round");
|
||||||
btnAdd.setButtonType(JFXButton.ButtonType.RAISED);
|
btnAdd.setButtonType(JFXButton.ButtonType.RAISED);
|
||||||
btnAdd.setGraphic(SVG.PLUS.createIcon(Theme.whiteFill(), -1, -1));
|
btnAdd.setGraphic(SVG.PLUS.createIcon(Theme.whiteFill(), -1, -1));
|
||||||
btnAdd.setOnMouseClicked(e -> skinnable.add());
|
btnAdd.setOnAction(e -> skinnable.add());
|
||||||
|
|
||||||
JFXButton btnRefresh = new JFXButton();
|
JFXButton btnRefresh = new JFXButton();
|
||||||
FXUtils.setLimitWidth(btnRefresh, 40);
|
FXUtils.setLimitWidth(btnRefresh, 40);
|
||||||
@ -78,7 +78,7 @@ public class ListPageSkin extends SkinBase<ListPage<?>> {
|
|||||||
btnRefresh.getStyleClass().add("jfx-button-raised-round");
|
btnRefresh.getStyleClass().add("jfx-button-raised-round");
|
||||||
btnRefresh.setButtonType(JFXButton.ButtonType.RAISED);
|
btnRefresh.setButtonType(JFXButton.ButtonType.RAISED);
|
||||||
btnRefresh.setGraphic(SVG.REFRESH.createIcon(Theme.whiteFill(), -1, -1));
|
btnRefresh.setGraphic(SVG.REFRESH.createIcon(Theme.whiteFill(), -1, -1));
|
||||||
btnRefresh.setOnMouseClicked(e -> skinnable.refresh());
|
btnRefresh.setOnAction(e -> skinnable.refresh());
|
||||||
|
|
||||||
vBox.getChildren().setAll(btnAdd);
|
vBox.getChildren().setAll(btnAdd);
|
||||||
|
|
||||||
|
@ -91,7 +91,7 @@ public abstract class ToolbarListPageSkin<T extends ListPageBase<? extends Node>
|
|||||||
ret.textFillProperty().bind(Theme.foregroundFillBinding());
|
ret.textFillProperty().bind(Theme.foregroundFillBinding());
|
||||||
ret.setGraphic(wrap(svg.createIcon(Theme.foregroundFillBinding(), -1, -1)));
|
ret.setGraphic(wrap(svg.createIcon(Theme.foregroundFillBinding(), -1, -1)));
|
||||||
ret.setText(text);
|
ret.setText(text);
|
||||||
ret.setOnMouseClicked(e -> onClick.run());
|
ret.setOnAction(e -> onClick.run());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ public abstract class ToolbarListPageSkin<T extends ListPageBase<? extends Node>
|
|||||||
ret.getStyleClass().add("jfx-tool-bar-button");
|
ret.getStyleClass().add("jfx-tool-bar-button");
|
||||||
ret.setGraphic(wrap(svg.createIcon(Theme.blackFill(), -1, -1)));
|
ret.setGraphic(wrap(svg.createIcon(Theme.blackFill(), -1, -1)));
|
||||||
ret.setText(text);
|
ret.setText(text);
|
||||||
ret.setOnMouseClicked(e -> onClick.run());
|
ret.setOnAction(e -> onClick.run());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,7 +110,7 @@ public abstract class ToolbarListPageSkin<T extends ListPageBase<? extends Node>
|
|||||||
ret.textFillProperty().bind(Theme.foregroundFillBinding());
|
ret.textFillProperty().bind(Theme.foregroundFillBinding());
|
||||||
ret.setGraphic(wrap(svg.createIcon(Theme.foregroundFillBinding(), -1, -1)));
|
ret.setGraphic(wrap(svg.createIcon(Theme.foregroundFillBinding(), -1, -1)));
|
||||||
FXUtils.installFastTooltip(ret, tooltip);
|
FXUtils.installFastTooltip(ret, tooltip);
|
||||||
ret.setOnMouseClicked(e -> onClick.run());
|
ret.setOnAction(e -> onClick.run());
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@ public class AccountListItemSkin extends SkinBase<AccountListItem> {
|
|||||||
JFXButton btnMove = new JFXButton();
|
JFXButton btnMove = new JFXButton();
|
||||||
SpinnerPane spinnerMove = new SpinnerPane();
|
SpinnerPane spinnerMove = new SpinnerPane();
|
||||||
spinnerMove.getStyleClass().add("small-spinner-pane");
|
spinnerMove.getStyleClass().add("small-spinner-pane");
|
||||||
btnMove.setOnMouseClicked(e -> {
|
btnMove.setOnAction(e -> {
|
||||||
Account account = skinnable.getAccount();
|
Account account = skinnable.getAccount();
|
||||||
Accounts.getAccounts().remove(account);
|
Accounts.getAccounts().remove(account);
|
||||||
if (account.isPortable()) {
|
if (account.isPortable()) {
|
||||||
@ -129,7 +129,7 @@ public class AccountListItemSkin extends SkinBase<AccountListItem> {
|
|||||||
JFXButton btnRefresh = new JFXButton();
|
JFXButton btnRefresh = new JFXButton();
|
||||||
SpinnerPane spinnerRefresh = new SpinnerPane();
|
SpinnerPane spinnerRefresh = new SpinnerPane();
|
||||||
spinnerRefresh.getStyleClass().setAll("small-spinner-pane");
|
spinnerRefresh.getStyleClass().setAll("small-spinner-pane");
|
||||||
btnRefresh.setOnMouseClicked(e -> {
|
btnRefresh.setOnAction(e -> {
|
||||||
spinnerRefresh.showSpinner();
|
spinnerRefresh.showSpinner();
|
||||||
skinnable.refreshAsync()
|
skinnable.refreshAsync()
|
||||||
.whenComplete(Schedulers.javafx(), ex -> {
|
.whenComplete(Schedulers.javafx(), ex -> {
|
||||||
@ -149,7 +149,7 @@ public class AccountListItemSkin extends SkinBase<AccountListItem> {
|
|||||||
|
|
||||||
JFXButton btnUpload = new JFXButton();
|
JFXButton btnUpload = new JFXButton();
|
||||||
SpinnerPane spinnerUpload = new SpinnerPane();
|
SpinnerPane spinnerUpload = new SpinnerPane();
|
||||||
btnUpload.setOnMouseClicked(e -> {
|
btnUpload.setOnAction(e -> {
|
||||||
Task<?> uploadTask = skinnable.uploadSkin();
|
Task<?> uploadTask = skinnable.uploadSkin();
|
||||||
if (uploadTask != null) {
|
if (uploadTask != null) {
|
||||||
spinnerUpload.showSpinner();
|
spinnerUpload.showSpinner();
|
||||||
@ -170,14 +170,14 @@ public class AccountListItemSkin extends SkinBase<AccountListItem> {
|
|||||||
JFXButton btnCopyUUID = new JFXButton();
|
JFXButton btnCopyUUID = new JFXButton();
|
||||||
SpinnerPane spinnerCopyUUID = new SpinnerPane();
|
SpinnerPane spinnerCopyUUID = new SpinnerPane();
|
||||||
spinnerCopyUUID.getStyleClass().add("small-spinner-pane");
|
spinnerCopyUUID.getStyleClass().add("small-spinner-pane");
|
||||||
btnCopyUUID.setOnMouseClicked(e -> FXUtils.copyText(skinnable.getAccount().getUUID().toString()));
|
btnCopyUUID.setOnAction(e -> FXUtils.copyText(skinnable.getAccount().getUUID().toString()));
|
||||||
btnCopyUUID.setGraphic(SVG.COPY.createIcon(Theme.blackFill(), -1, -1));
|
btnCopyUUID.setGraphic(SVG.COPY.createIcon(Theme.blackFill(), -1, -1));
|
||||||
runInFX(() -> FXUtils.installFastTooltip(btnCopyUUID, i18n("account.copy_uuid")));
|
runInFX(() -> FXUtils.installFastTooltip(btnCopyUUID, i18n("account.copy_uuid")));
|
||||||
spinnerCopyUUID.setContent(btnCopyUUID);
|
spinnerCopyUUID.setContent(btnCopyUUID);
|
||||||
right.getChildren().add(spinnerCopyUUID);
|
right.getChildren().add(spinnerCopyUUID);
|
||||||
|
|
||||||
JFXButton btnRemove = new JFXButton();
|
JFXButton btnRemove = new JFXButton();
|
||||||
btnRemove.setOnMouseClicked(e -> Controllers.confirm(i18n("button.remove.confirm"), i18n("button.remove"), skinnable::remove, null));
|
btnRemove.setOnAction(e -> Controllers.confirm(i18n("button.remove.confirm"), i18n("button.remove"), skinnable::remove, null));
|
||||||
btnRemove.getStyleClass().add("toggle-icon4");
|
btnRemove.getStyleClass().add("toggle-icon4");
|
||||||
BorderPane.setAlignment(btnRemove, Pos.CENTER);
|
BorderPane.setAlignment(btnRemove, Pos.CENTER);
|
||||||
btnRemove.setGraphic(SVG.DELETE.createIcon(Theme.blackFill(), -1, -1));
|
btnRemove.setGraphic(SVG.DELETE.createIcon(Theme.blackFill(), -1, -1));
|
||||||
|
@ -60,7 +60,7 @@ public class FileItem extends BorderPane {
|
|||||||
JFXButton right = new JFXButton();
|
JFXButton right = new JFXButton();
|
||||||
right.setGraphic(SVG.PENCIL.createIcon(Theme.blackFill(), 15, 15));
|
right.setGraphic(SVG.PENCIL.createIcon(Theme.blackFill(), 15, 15));
|
||||||
right.getStyleClass().add("toggle-icon4");
|
right.getStyleClass().add("toggle-icon4");
|
||||||
right.setOnMouseClicked(e -> onExplore());
|
right.setOnAction(e -> onExplore());
|
||||||
FXUtils.installFastTooltip(right, i18n("button.edit"));
|
FXUtils.installFastTooltip(right, i18n("button.edit"));
|
||||||
setRight(right);
|
setRight(right);
|
||||||
|
|
||||||
|
@ -222,7 +222,7 @@ public class InstallersPage extends Control implements WizardPage {
|
|||||||
installButton.disableProperty().bind(control.installable.not());
|
installButton.disableProperty().bind(control.installable.not());
|
||||||
installButton.setPrefWidth(100);
|
installButton.setPrefWidth(100);
|
||||||
installButton.setPrefHeight(40);
|
installButton.setPrefHeight(40);
|
||||||
installButton.setOnMouseClicked(e -> control.onInstall());
|
installButton.setOnAction(e -> control.onInstall());
|
||||||
BorderPane.setAlignment(installButton, Pos.CENTER_RIGHT);
|
BorderPane.setAlignment(installButton, Pos.CENTER_RIGHT);
|
||||||
root.setBottom(installButton);
|
root.setBottom(installButton);
|
||||||
}
|
}
|
||||||
|
@ -178,9 +178,7 @@ public final class ModpackInfoPage extends Control implements WizardPage {
|
|||||||
|
|
||||||
if (skinnable.controller.getSettings().get(MODPACK_TYPE) == MODPACK_TYPE_SERVER) {
|
if (skinnable.controller.getSettings().get(MODPACK_TYPE) == MODPACK_TYPE_SERVER) {
|
||||||
Hyperlink hyperlink = new Hyperlink(i18n("modpack.wizard.step.initialization.server"));
|
Hyperlink hyperlink = new Hyperlink(i18n("modpack.wizard.step.initialization.server"));
|
||||||
hyperlink.setOnMouseClicked(e -> {
|
hyperlink.setOnAction(e -> FXUtils.openLink("https://docs.hmcl.net/modpack/serverpack.html"));
|
||||||
FXUtils.openLink("https://docs.hmcl.net/modpack/serverpack.html");
|
|
||||||
});
|
|
||||||
borderPane.setTop(hyperlink);
|
borderPane.setTop(hyperlink);
|
||||||
} else {
|
} else {
|
||||||
HintPane pane = new HintPane(MessageDialogPane.MessageType.INFO);
|
HintPane pane = new HintPane(MessageDialogPane.MessageType.INFO);
|
||||||
|
@ -144,7 +144,7 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
|||||||
StackPane.setAlignment(closeUpdateButton, Pos.TOP_RIGHT);
|
StackPane.setAlignment(closeUpdateButton, Pos.TOP_RIGHT);
|
||||||
closeUpdateButton.getStyleClass().add("toggle-icon-tiny");
|
closeUpdateButton.getStyleClass().add("toggle-icon-tiny");
|
||||||
StackPane.setMargin(closeUpdateButton, new Insets(5));
|
StackPane.setMargin(closeUpdateButton, new Insets(5));
|
||||||
closeUpdateButton.setOnMouseClicked(e -> closeUpdateBubble());
|
closeUpdateButton.setOnAction(e -> closeUpdateBubble());
|
||||||
|
|
||||||
updatePane.getChildren().setAll(hBox, closeUpdateButton);
|
updatePane.getChildren().setAll(hBox, closeUpdateButton);
|
||||||
}
|
}
|
||||||
@ -206,7 +206,7 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
|||||||
menuButton.setPrefWidth(230);
|
menuButton.setPrefWidth(230);
|
||||||
//menuButton.setButtonType(JFXButton.ButtonType.RAISED);
|
//menuButton.setButtonType(JFXButton.ButtonType.RAISED);
|
||||||
menuButton.setStyle("-fx-font-size: 15px;");
|
menuButton.setStyle("-fx-font-size: 15px;");
|
||||||
menuButton.setOnMouseClicked(e -> onMenu());
|
menuButton.setOnAction(e -> onMenu());
|
||||||
menuButton.setClip(new Rectangle(211, -100, 100, 200));
|
menuButton.setClip(new Rectangle(211, -100, 100, 200));
|
||||||
StackPane graphic = new StackPane();
|
StackPane graphic = new StackPane();
|
||||||
Node svg = SVG.TRIANGLE.createIcon(Theme.foregroundFillBinding(), 10, 10);
|
Node svg = SVG.TRIANGLE.createIcon(Theme.foregroundFillBinding(), 10, 10);
|
||||||
|
@ -121,7 +121,7 @@ public abstract class SettingsView extends StackPane {
|
|||||||
|
|
||||||
{
|
{
|
||||||
btnUpdate = new JFXButton();
|
btnUpdate = new JFXButton();
|
||||||
btnUpdate.setOnMouseClicked(e -> onUpdate());
|
btnUpdate.setOnAction(e -> onUpdate());
|
||||||
btnUpdate.getStyleClass().add("toggle-icon4");
|
btnUpdate.getStyleClass().add("toggle-icon4");
|
||||||
btnUpdate.setGraphic(SVG.UPDATE.createIcon(Theme.blackFill(), 20, 20));
|
btnUpdate.setGraphic(SVG.UPDATE.createIcon(Theme.blackFill(), 20, 20));
|
||||||
|
|
||||||
@ -161,7 +161,7 @@ public abstract class SettingsView extends StackPane {
|
|||||||
|
|
||||||
{
|
{
|
||||||
JFXButton cleanButton = new JFXButton(i18n("launcher.cache_directory.clean"));
|
JFXButton cleanButton = new JFXButton(i18n("launcher.cache_directory.clean"));
|
||||||
cleanButton.setOnMouseClicked(e -> clearCacheDirectory());
|
cleanButton.setOnAction(e -> clearCacheDirectory());
|
||||||
cleanButton.getStyleClass().add("jfx-button-border");
|
cleanButton.getStyleClass().add("jfx-button-border");
|
||||||
|
|
||||||
fileCommonLocationSublist.setHeaderRight(cleanButton);
|
fileCommonLocationSublist.setHeaderRight(cleanButton);
|
||||||
@ -193,11 +193,11 @@ public abstract class SettingsView extends StackPane {
|
|||||||
debugPane.setLeft(left);
|
debugPane.setLeft(left);
|
||||||
|
|
||||||
JFXButton openLogFolderButton = new JFXButton(i18n("settings.launcher.launcher_log.reveal"));
|
JFXButton openLogFolderButton = new JFXButton(i18n("settings.launcher.launcher_log.reveal"));
|
||||||
openLogFolderButton.setOnMouseClicked(e -> openLogFolder());
|
openLogFolderButton.setOnAction(e -> openLogFolder());
|
||||||
openLogFolderButton.getStyleClass().add("jfx-button-border");
|
openLogFolderButton.getStyleClass().add("jfx-button-border");
|
||||||
|
|
||||||
JFXButton logButton = new JFXButton(i18n("settings.launcher.launcher_log.export"));
|
JFXButton logButton = new JFXButton(i18n("settings.launcher.launcher_log.export"));
|
||||||
logButton.setOnMouseClicked(e -> onExportLogs());
|
logButton.setOnAction(e -> onExportLogs());
|
||||||
logButton.getStyleClass().add("jfx-button-border");
|
logButton.getStyleClass().add("jfx-button-border");
|
||||||
|
|
||||||
HBox buttonBox = new HBox();
|
HBox buttonBox = new HBox();
|
||||||
|
@ -64,7 +64,7 @@ public class ProfileListItemSkin extends SkinBase<ProfileListItem> {
|
|||||||
right.setAlignment(Pos.CENTER_RIGHT);
|
right.setAlignment(Pos.CENTER_RIGHT);
|
||||||
|
|
||||||
JFXButton btnRemove = new JFXButton();
|
JFXButton btnRemove = new JFXButton();
|
||||||
btnRemove.setOnMouseClicked(e -> skinnable.remove());
|
btnRemove.setOnAction(e -> skinnable.remove());
|
||||||
btnRemove.getStyleClass().add("toggle-icon4");
|
btnRemove.getStyleClass().add("toggle-icon4");
|
||||||
BorderPane.setAlignment(btnRemove, Pos.CENTER);
|
BorderPane.setAlignment(btnRemove, Pos.CENTER);
|
||||||
btnRemove.setGraphic(SVG.CLOSE.createIcon(Theme.blackFill(), 14, 14));
|
btnRemove.setGraphic(SVG.CLOSE.createIcon(Theme.blackFill(), 14, 14));
|
||||||
|
@ -79,7 +79,7 @@ public class GameListItemSkin extends SkinBase<GameListItem> {
|
|||||||
right.setAlignment(Pos.CENTER_RIGHT);
|
right.setAlignment(Pos.CENTER_RIGHT);
|
||||||
if (skinnable.canUpdate()) {
|
if (skinnable.canUpdate()) {
|
||||||
JFXButton btnUpgrade = new JFXButton();
|
JFXButton btnUpgrade = new JFXButton();
|
||||||
btnUpgrade.setOnMouseClicked(e -> skinnable.update());
|
btnUpgrade.setOnAction(e -> skinnable.update());
|
||||||
btnUpgrade.getStyleClass().add("toggle-icon4");
|
btnUpgrade.getStyleClass().add("toggle-icon4");
|
||||||
btnUpgrade.setGraphic(FXUtils.limitingSize(SVG.UPDATE.createIcon(Theme.blackFill(), 24, 24), 24, 24));
|
btnUpgrade.setGraphic(FXUtils.limitingSize(SVG.UPDATE.createIcon(Theme.blackFill(), 24, 24), 24, 24));
|
||||||
runInFX(() -> FXUtils.installFastTooltip(btnUpgrade, i18n("version.update")));
|
runInFX(() -> FXUtils.installFastTooltip(btnUpgrade, i18n("version.update")));
|
||||||
@ -88,7 +88,7 @@ public class GameListItemSkin extends SkinBase<GameListItem> {
|
|||||||
|
|
||||||
{
|
{
|
||||||
JFXButton btnLaunch = new JFXButton();
|
JFXButton btnLaunch = new JFXButton();
|
||||||
btnLaunch.setOnMouseClicked(e -> skinnable.launch());
|
btnLaunch.setOnAction(e -> skinnable.launch());
|
||||||
btnLaunch.getStyleClass().add("toggle-icon4");
|
btnLaunch.getStyleClass().add("toggle-icon4");
|
||||||
BorderPane.setAlignment(btnLaunch, Pos.CENTER);
|
BorderPane.setAlignment(btnLaunch, Pos.CENTER);
|
||||||
btnLaunch.setGraphic(FXUtils.limitingSize(SVG.ROCKET_LAUNCH_OUTLINE.createIcon(Theme.blackFill(), 24, 24), 24, 24));
|
btnLaunch.setGraphic(FXUtils.limitingSize(SVG.ROCKET_LAUNCH_OUTLINE.createIcon(Theme.blackFill(), 24, 24), 24, 24));
|
||||||
@ -98,7 +98,7 @@ public class GameListItemSkin extends SkinBase<GameListItem> {
|
|||||||
|
|
||||||
{
|
{
|
||||||
JFXButton btnManage = new JFXButton();
|
JFXButton btnManage = new JFXButton();
|
||||||
btnManage.setOnMouseClicked(e -> {
|
btnManage.setOnAction(e -> {
|
||||||
currentSkinnable = skinnable;
|
currentSkinnable = skinnable;
|
||||||
popup.get().show(root, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, root.getHeight());
|
popup.get().show(root, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, root.getHeight());
|
||||||
});
|
});
|
||||||
|
@ -539,7 +539,7 @@ class ModListPageSkin extends SkinBase<ModListPage> {
|
|||||||
}
|
}
|
||||||
checkBox.selectedProperty().bindBidirectional(booleanProperty = dataItem.active);
|
checkBox.selectedProperty().bindBidirectional(booleanProperty = dataItem.active);
|
||||||
restoreButton.setVisible(!dataItem.getModInfo().getMod().getOldFiles().isEmpty());
|
restoreButton.setVisible(!dataItem.getModInfo().getMod().getOldFiles().isEmpty());
|
||||||
restoreButton.setOnMouseClicked(e -> {
|
restoreButton.setOnAction(e -> {
|
||||||
menu.get().getContent().setAll(dataItem.getModInfo().getMod().getOldFiles().stream()
|
menu.get().getContent().setAll(dataItem.getModInfo().getMod().getOldFiles().stream()
|
||||||
.map(localModFile -> new IconedMenuItem(null, localModFile.getVersion(),
|
.map(localModFile -> new IconedMenuItem(null, localModFile.getVersion(),
|
||||||
() -> getSkinnable().rollback(dataItem.getModInfo(), localModFile),
|
() -> getSkinnable().rollback(dataItem.getModInfo(), localModFile),
|
||||||
@ -549,12 +549,8 @@ class ModListPageSkin extends SkinBase<ModListPage> {
|
|||||||
|
|
||||||
popup.get().show(restoreButton, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, restoreButton.getHeight());
|
popup.get().show(restoreButton, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, restoreButton.getHeight());
|
||||||
});
|
});
|
||||||
revealButton.setOnMouseClicked(e -> {
|
revealButton.setOnAction(e -> FXUtils.showFileInExplorer(dataItem.getModInfo().getFile()));
|
||||||
FXUtils.showFileInExplorer(dataItem.getModInfo().getFile());
|
infoButton.setOnAction(e -> Controllers.dialog(new ModInfoDialog(dataItem)));
|
||||||
});
|
|
||||||
infoButton.setOnMouseClicked(e -> {
|
|
||||||
Controllers.dialog(new ModInfoDialog(dataItem));
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -83,7 +83,7 @@ public class WorldExportPageSkin extends SkinBase<WorldExportPage> {
|
|||||||
JFXButton btnExport = FXUtils.newRaisedButton(i18n("button.export"));
|
JFXButton btnExport = FXUtils.newRaisedButton(i18n("button.export"));
|
||||||
btnExport.disableProperty().bind(Bindings.createBooleanBinding(() -> txtWorldName.getText().isEmpty() || Files.exists(Paths.get(fileItem.getPath())),
|
btnExport.disableProperty().bind(Bindings.createBooleanBinding(() -> txtWorldName.getText().isEmpty() || Files.exists(Paths.get(fileItem.getPath())),
|
||||||
txtWorldName.textProperty().isEmpty(), fileItem.pathProperty()));
|
txtWorldName.textProperty().isEmpty(), fileItem.pathProperty()));
|
||||||
btnExport.setOnMouseClicked(e -> skinnable.export());
|
btnExport.setOnAction(e -> skinnable.export());
|
||||||
HBox bottom = new HBox();
|
HBox bottom = new HBox();
|
||||||
bottom.setAlignment(Pos.CENTER_RIGHT);
|
bottom.setAlignment(Pos.CENTER_RIGHT);
|
||||||
bottom.getChildren().setAll(btnExport);
|
bottom.getChildren().setAll(btnExport);
|
||||||
|
@ -76,9 +76,7 @@ public class WorldListItemSkin extends SkinBase<WorldListItem> {
|
|||||||
right.setAlignment(Pos.CENTER_RIGHT);
|
right.setAlignment(Pos.CENTER_RIGHT);
|
||||||
|
|
||||||
JFXButton btnManage = new JFXButton();
|
JFXButton btnManage = new JFXButton();
|
||||||
btnManage.setOnMouseClicked(e -> {
|
btnManage.setOnAction(e -> popup.show(root, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, root.getHeight()));
|
||||||
popup.show(root, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, root.getHeight());
|
|
||||||
});
|
|
||||||
btnManage.getStyleClass().add("toggle-icon4");
|
btnManage.getStyleClass().add("toggle-icon4");
|
||||||
BorderPane.setAlignment(btnManage, Pos.CENTER);
|
BorderPane.setAlignment(btnManage, Pos.CENTER);
|
||||||
btnManage.setGraphic(SVG.DOTS_VERTICAL.createIcon(Theme.blackFill(), -1, -1));
|
btnManage.setGraphic(SVG.DOTS_VERTICAL.createIcon(Theme.blackFill(), -1, -1));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user