Hide refresh and add button in MainPage

This commit is contained in:
huangyuhui
2018-03-02 19:22:10 +08:00
parent f826eb224c
commit ba359305f6
4 changed files with 18 additions and 17 deletions

View File

@@ -356,7 +356,8 @@ public final class LauncherHelper {
});
break;
case CLOSE:
throw new Error("Never come to here");
// Never come to here.
break;
case KEEP:
// No operations here
break;

View File

@@ -209,7 +209,7 @@ public final class MainPage extends StackPane implements DecoratorPage {
}
private void loadingVersions() {
contentPane.getChildren().setAll(spinner);
getChildren().setAll(spinner);
FXUtils.resetChildren(masonryPane, Collections.emptyList());
}
@@ -220,7 +220,7 @@ public final class MainPage extends StackPane implements DecoratorPage {
}
JFXUtilities.runInFX(() -> {
if (profile == repository.getProfile()) {
contentPane.getChildren().setAll(masonryPane);
getChildren().setAll(contentPane);
FXUtils.resetChildren(masonryPane, children);
}
});

View File

@@ -10,23 +10,23 @@
maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
type="StackPane" pickOnBounds="false"
xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1">
<JFXSpinner fx:id="spinner" styleClass="first-spinner" />
<StackPane fx:id="contentPane">
<JFXSpinner fx:id="spinner" styleClass="first-spinner" />
<ScrollPane fitToHeight="true" fitToWidth="true" fx:id="scrollPane" hbarPolicy="NEVER">
<JFXMasonryPane fx:id="masonryPane" HSpacing="3" VSpacing="3" cellWidth="182" cellHeight="160">
</JFXMasonryPane>
</ScrollPane>
<VBox style="-fx-padding: 15;" spacing="15" pickOnBounds="false" alignment="BOTTOM_RIGHT">
<JFXButton prefWidth="40" prefHeight="40" buttonType="RAISED" fx:id="btnRefresh" styleClass="jfx-button-raised-round">
<graphic>
<fx:include source="/assets/svg/refresh.fxml" />
</graphic>
</JFXButton>
<JFXButton prefWidth="40" prefHeight="40" buttonType="RAISED" fx:id="btnAdd" styleClass="jfx-button-raised-round">
<graphic>
<fx:include source="/assets/svg/plus.fxml" />
</graphic>
</JFXButton>
</VBox>
</StackPane>
<VBox style="-fx-padding: 15;" spacing="15" pickOnBounds="false" alignment="BOTTOM_RIGHT">
<JFXButton prefWidth="40" prefHeight="40" buttonType="RAISED" fx:id="btnRefresh" styleClass="jfx-button-raised-round">
<graphic>
<fx:include source="/assets/svg/refresh.fxml" />
</graphic>
</JFXButton>
<JFXButton prefWidth="40" prefHeight="40" buttonType="RAISED" fx:id="btnAdd" styleClass="jfx-button-raised-round">
<graphic>
<fx:include source="/assets/svg/plus.fxml" />
</graphic>
</JFXButton>
</VBox>
</fx:root>

View File

@@ -62,7 +62,7 @@ public class DefaultGameRepository implements GameRepository {
@Override
public Version getVersion(String id) {
if (!hasVersion(id))
throw new VersionNotFoundException("Version '" + id + "' does not exist.");
throw new VersionNotFoundException("Version '" + id + "' does not exist in " + versions.keySet() + ".");
return versions.get(id);
}