add: launch button in gamelist
This commit is contained in:
@@ -200,6 +200,14 @@ public class RootPage extends DecoratorTabPage {
|
|||||||
return profileTab;
|
return profileTab;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void selectPage(Tab tab) {
|
||||||
|
if (getSelectionModel().getSelectedItem() == tab) {
|
||||||
|
getSelectionModel().select(getMainTab());
|
||||||
|
} else {
|
||||||
|
getSelectionModel().select(tab);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private static class Skin extends SkinBase<RootPage> {
|
private static class Skin extends SkinBase<RootPage> {
|
||||||
|
|
||||||
protected Skin(RootPage control) {
|
protected Skin(RootPage control) {
|
||||||
@@ -208,7 +216,7 @@ public class RootPage extends DecoratorTabPage {
|
|||||||
// first item in left sidebar
|
// first item in left sidebar
|
||||||
AccountAdvancedListItem accountListItem = new AccountAdvancedListItem();
|
AccountAdvancedListItem accountListItem = new AccountAdvancedListItem();
|
||||||
accountListItem.activeProperty().bind(control.accountTab.selectedProperty());
|
accountListItem.activeProperty().bind(control.accountTab.selectedProperty());
|
||||||
accountListItem.setOnAction(e -> control.getSelectionModel().select(control.accountTab));
|
accountListItem.setOnAction(e -> control.selectPage(control.accountTab));
|
||||||
accountListItem.accountProperty().bind(Accounts.selectedAccountProperty());
|
accountListItem.accountProperty().bind(Accounts.selectedAccountProperty());
|
||||||
|
|
||||||
// second item in left sidebar
|
// second item in left sidebar
|
||||||
@@ -218,7 +226,7 @@ public class RootPage extends DecoratorTabPage {
|
|||||||
Profile profile = Profiles.getSelectedProfile();
|
Profile profile = Profiles.getSelectedProfile();
|
||||||
String version = Profiles.getSelectedVersion();
|
String version = Profiles.getSelectedVersion();
|
||||||
if (version == null) {
|
if (version == null) {
|
||||||
control.getSelectionModel().select(control.gameTab);
|
control.selectPage(control.gameTab);
|
||||||
} else {
|
} else {
|
||||||
Versions.modifyGameSettings(profile, version);
|
Versions.modifyGameSettings(profile, version);
|
||||||
}
|
}
|
||||||
@@ -229,12 +237,12 @@ public class RootPage extends DecoratorTabPage {
|
|||||||
gameItem.activeProperty().bind(control.gameTab.selectedProperty());
|
gameItem.activeProperty().bind(control.gameTab.selectedProperty());
|
||||||
gameItem.setImage(newImage("/assets/img/bookshelf.png"));
|
gameItem.setImage(newImage("/assets/img/bookshelf.png"));
|
||||||
gameItem.setTitle(i18n("version.manage"));
|
gameItem.setTitle(i18n("version.manage"));
|
||||||
gameItem.setOnAction(e -> control.getSelectionModel().select(control.gameTab));
|
gameItem.setOnAction(e -> control.selectPage(control.gameTab));
|
||||||
|
|
||||||
// forth item in left sidebar
|
// forth item in left sidebar
|
||||||
ProfileAdvancedListItem profileListItem = new ProfileAdvancedListItem();
|
ProfileAdvancedListItem profileListItem = new ProfileAdvancedListItem();
|
||||||
profileListItem.activeProperty().bind(control.profileTab.selectedProperty());
|
profileListItem.activeProperty().bind(control.profileTab.selectedProperty());
|
||||||
profileListItem.setOnAction(e -> control.getSelectionModel().select(control.profileTab));
|
profileListItem.setOnAction(e -> control.selectPage(control.profileTab));
|
||||||
profileListItem.profileProperty().bind(Profiles.selectedProfileProperty());
|
profileListItem.profileProperty().bind(Profiles.selectedProfileProperty());
|
||||||
|
|
||||||
// fifth item in left sidebar
|
// fifth item in left sidebar
|
||||||
@@ -242,7 +250,7 @@ public class RootPage extends DecoratorTabPage {
|
|||||||
launcherSettingsItem.activeProperty().bind(control.settingsTab.selectedProperty());
|
launcherSettingsItem.activeProperty().bind(control.settingsTab.selectedProperty());
|
||||||
launcherSettingsItem.setImage(newImage("/assets/img/command.png"));
|
launcherSettingsItem.setImage(newImage("/assets/img/command.png"));
|
||||||
launcherSettingsItem.setTitle(i18n("settings.launcher"));
|
launcherSettingsItem.setTitle(i18n("settings.launcher"));
|
||||||
launcherSettingsItem.setOnAction(e -> control.getSelectionModel().select(control.settingsTab));
|
launcherSettingsItem.setOnAction(e -> control.selectPage(control.settingsTab));
|
||||||
|
|
||||||
// the left sidebar
|
// the left sidebar
|
||||||
AdvancedListBox sideBar = new AdvancedListBox()
|
AdvancedListBox sideBar = new AdvancedListBox()
|
||||||
|
|||||||
@@ -87,15 +87,27 @@ public class GameListItemSkin extends SkinBase<GameListItem> {
|
|||||||
right.getChildren().add(btnUpgrade);
|
right.getChildren().add(btnUpgrade);
|
||||||
}
|
}
|
||||||
|
|
||||||
JFXButton btnManage = new JFXButton();
|
{
|
||||||
btnManage.setOnMouseClicked(e -> {
|
JFXButton btnLaunch = new JFXButton();
|
||||||
currentSkinnable = skinnable;
|
btnLaunch.setOnMouseClicked(e -> skinnable.launch());
|
||||||
popup.show(root, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, root.getHeight());
|
btnLaunch.getStyleClass().add("toggle-icon4");
|
||||||
});
|
BorderPane.setAlignment(btnLaunch, Pos.CENTER);
|
||||||
btnManage.getStyleClass().add("toggle-icon4");
|
btnLaunch.setGraphic(SVG.launch(Theme.blackFillBinding(), 20, 20));
|
||||||
BorderPane.setAlignment(btnManage, Pos.CENTER);
|
right.getChildren().add(btnLaunch);
|
||||||
btnManage.setGraphic(SVG.dotsVertical(Theme.blackFillBinding(), -1, -1));
|
}
|
||||||
right.getChildren().add(btnManage);
|
|
||||||
|
{
|
||||||
|
JFXButton btnManage = new JFXButton();
|
||||||
|
btnManage.setOnMouseClicked(e -> {
|
||||||
|
currentSkinnable = skinnable;
|
||||||
|
popup.show(root, JFXPopup.PopupVPosition.TOP, JFXPopup.PopupHPosition.RIGHT, 0, root.getHeight());
|
||||||
|
});
|
||||||
|
btnManage.getStyleClass().add("toggle-icon4");
|
||||||
|
BorderPane.setAlignment(btnManage, Pos.CENTER);
|
||||||
|
btnManage.setGraphic(SVG.dotsVertical(Theme.blackFillBinding(), -1, -1));
|
||||||
|
right.getChildren().add(btnManage);
|
||||||
|
}
|
||||||
|
|
||||||
root.setRight(right);
|
root.setRight(right);
|
||||||
|
|
||||||
root.getStyleClass().add("card");
|
root.getStyleClass().add("card");
|
||||||
|
|||||||
Reference in New Issue
Block a user