从首页打开子页面时应当打开默认标签页 (#4826)
This commit is contained in:
@@ -177,7 +177,10 @@ public class RootPage extends DecoratorAnimatedPage implements DecoratorPage {
|
|||||||
downloadItem.setLeftGraphic(wrap(SVG.DOWNLOAD));
|
downloadItem.setLeftGraphic(wrap(SVG.DOWNLOAD));
|
||||||
downloadItem.setActionButtonVisible(false);
|
downloadItem.setActionButtonVisible(false);
|
||||||
downloadItem.setTitle(i18n("download"));
|
downloadItem.setTitle(i18n("download"));
|
||||||
downloadItem.setOnAction(e -> Controllers.navigate(Controllers.getDownloadPage()));
|
downloadItem.setOnAction(e -> {
|
||||||
|
Controllers.getDownloadPage().showGameDownloads();
|
||||||
|
Controllers.navigate(Controllers.getDownloadPage());
|
||||||
|
});
|
||||||
FXUtils.installFastTooltip(downloadItem, i18n("download.hint"));
|
FXUtils.installFastTooltip(downloadItem, i18n("download.hint"));
|
||||||
if (AnimationUtils.isAnimationEnabled()) {
|
if (AnimationUtils.isAnimationEnabled()) {
|
||||||
FXUtils.prepareOnMouseEnter(downloadItem, Controllers::prepareDownloadPage);
|
FXUtils.prepareOnMouseEnter(downloadItem, Controllers::prepareDownloadPage);
|
||||||
@@ -188,7 +191,10 @@ public class RootPage extends DecoratorAnimatedPage implements DecoratorPage {
|
|||||||
launcherSettingsItem.setLeftGraphic(wrap(SVG.SETTINGS));
|
launcherSettingsItem.setLeftGraphic(wrap(SVG.SETTINGS));
|
||||||
launcherSettingsItem.setActionButtonVisible(false);
|
launcherSettingsItem.setActionButtonVisible(false);
|
||||||
launcherSettingsItem.setTitle(i18n("settings"));
|
launcherSettingsItem.setTitle(i18n("settings"));
|
||||||
launcherSettingsItem.setOnAction(e -> Controllers.navigate(Controllers.getSettingsPage()));
|
launcherSettingsItem.setOnAction(e -> {
|
||||||
|
Controllers.getSettingsPage().showGameSettings(Profiles.getSelectedProfile());
|
||||||
|
Controllers.navigate(Controllers.getSettingsPage());
|
||||||
|
});
|
||||||
if (AnimationUtils.isAnimationEnabled()) {
|
if (AnimationUtils.isAnimationEnabled()) {
|
||||||
FXUtils.prepareOnMouseEnter(launcherSettingsItem, Controllers::prepareSettingsPage);
|
FXUtils.prepareOnMouseEnter(launcherSettingsItem, Controllers::prepareSettingsPage);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,6 +105,10 @@ public class VersionPage extends DecoratorAnimatedPage implements DecoratorPage
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void showInstanceSettings() {
|
||||||
|
tab.select(versionSettingsTab, false);
|
||||||
|
}
|
||||||
|
|
||||||
public void setVersion(String version, Profile profile) {
|
public void setVersion(String version, Profile profile) {
|
||||||
this.version.set(new Profile.ProfileVersion(profile, version));
|
this.version.set(new Profile.ProfileVersion(profile, version));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,6 +287,7 @@ public final class Versions {
|
|||||||
|
|
||||||
public static void modifyGameSettings(Profile profile, String version) {
|
public static void modifyGameSettings(Profile profile, String version) {
|
||||||
Controllers.getVersionPage().setVersion(version, profile);
|
Controllers.getVersionPage().setVersion(version, profile);
|
||||||
|
Controllers.getVersionPage().showInstanceSettings();
|
||||||
// VersionPage.loadVersion will be invoked after navigation
|
// VersionPage.loadVersion will be invoked after navigation
|
||||||
Controllers.navigate(Controllers.getVersionPage());
|
Controllers.navigate(Controllers.getVersionPage());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user