Skip to content

Commit

Permalink
turn show/hide details button in custom games into an icon (FAForever…
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackYps committed May 28, 2020
1 parent e549651 commit 0b588cd
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -280,10 +280,10 @@ public void toggleSidePane() {

private void setSidePane(boolean displayed) {
if (displayed) {
toggleSidePaneButton.setText(i18n.get("view.hideSidePane"));
toggleSidePaneButton.setText("");
sidePaneColumn.setMinWidth(sidePaneColumn.getPrefWidth());
} else {
toggleSidePaneButton.setText(i18n.get("view.showSidePane"));
toggleSidePaneButton.setText("");
sidePaneColumn.setMinWidth(0);
}
}
Expand Down
11 changes: 4 additions & 7 deletions src/main/resources/theme/play/custom_games.fxml
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,6 @@
<HBox alignment="BASELINE_LEFT"/>
</children>
</FlowPane>
<Button fx:id="toggleSidePaneButton" minWidth="-Infinity" mnemonicParsing="false"
onAction="#toggleSidePane" text="%view.hideSidePane">
<padding>
<Insets right="50"/>
</padding>
</Button>
<ToggleButton fx:id="tableButton" minWidth="-Infinity" mnemonicParsing="false"
onAction="#onTableButtonClicked" styleClass="game-list-type"
text="%view.table">
Expand All @@ -70,9 +64,12 @@
<Label styleClass="icon" text=""/>
</graphic>
</ToggleButton>
<Button fx:id="toggleSidePaneButton" mnemonicParsing="false"
onAction="#toggleSidePane" styleClass="icon-button, small-button" text="">
</Button>
</children>
<padding>
<Insets bottom="10.0" left="20.0" right="10.0" top="10.0"/>
<Insets bottom="10.0" left="20.0" right="-10.0" top="10.0"/>
</padding>
</HBox>
<ScrollPane fx:id="gameDetailPane" maxWidth="1.7976931348623157E308" GridPane.columnIndex="1"
Expand Down
4 changes: 4 additions & 0 deletions src/main/resources/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,10 @@
-fx-background-color: transparent;
}

.small-button > .text {
-fx-font-size: 1em;
}

.more-button {
-fx-pref-height: 296px;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ public void testHideSidePane() {
assertFalse(preferencesService.getPreferences().isShowGameDetailsSidePane());
verify(preferencesService, atLeast(2)).storeInBackground();

assertEquals(instance.toggleSidePaneButton.getText(), i18n.get("view.showSidePane"));
assertEquals(instance.toggleSidePaneButton.getText(), "");
assertFalse(instance.gameDetailPane.isManaged());
assertFalse(instance.gameDetailPane.isVisible());
}
Expand Down

0 comments on commit 0b588cd

Please sign in to comment.