From 5da4ad7a62bb5e38347dcbf88def350cb6fda4ea Mon Sep 17 00:00:00 2001 From: Yuhui Huang Date: Mon, 2 Aug 2021 16:16:21 +0800 Subject: [PATCH] feat: refine GameListPage UI. --- .../org/jackhuang/hmcl/ui/versions/GameListPage.java | 9 +++++---- .../java/org/jackhuang/hmcl/ui/versions/VersionPage.java | 2 +- HMCL/src/main/resources/assets/css/root.css | 4 ++-- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java index 86fa7bcb0..72868b970 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/GameListPage.java @@ -69,7 +69,7 @@ public class GameListPage extends ListPageBase implements Decorato }); profileListItems = MappedObservableList.create(profilesProperty(), profile -> { ProfileListItem item = new ProfileListItem(profile); - FXUtils.setLimitWidth(item, 300); + FXUtils.setLimitWidth(item, 200); return item; }); selectedProfile = createSelectedItemPropertyFor(profileListItems, Profile.class); @@ -116,7 +116,7 @@ public class GameListPage extends ListPageBase implements Decorato { BorderPane left = new BorderPane(); - FXUtils.setLimitWidth(left, 300); + FXUtils.setLimitWidth(left, 200); root.setLeft(left); { @@ -129,6 +129,7 @@ public class GameListPage extends ListPageBase implements Decorato ScrollPane pane = new ScrollPane(); VBox wrapper = new VBox(); + wrapper.getStyleClass().add("advanced-list-box-content"); VBox box = new VBox(); Bindings.bindContent(box.getChildren(), profileListItems); wrapper.getChildren().setAll(box, addProfileItem); @@ -170,7 +171,7 @@ public class GameListPage extends ListPageBase implements Decorato .add(installModpackItem) .add(refreshItem) .add(globalManageItem); - FXUtils.setLimitHeight(bottomLeftCornerList, 40 * 4 + 18); + FXUtils.setLimitHeight(bottomLeftCornerList, 40 * 4 + 12 * 2); left.setBottom(bottomLeftCornerList); } } @@ -235,7 +236,7 @@ public class GameListPage extends ListPageBase implements Decorato public GameListSkin() { super(GameList.this); - state.set(new State(i18n("version.manage"), null, true, false, true, false, 300)); + state.set(new State(i18n("version.manage"), null, true, false, true, false, 200)); } @Override diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java index c7349c54c..f489caa1c 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/VersionPage.java @@ -332,7 +332,7 @@ public class VersionPage extends Control implements DecoratorPage { .add(browseMenuItem) .add(managementItem); toolbar.getStyleClass().add("advanced-list-box-clear-padding"); - FXUtils.setLimitHeight(toolbar, 40 * 4 + 18); + FXUtils.setLimitHeight(toolbar, 40 * 4 + 12 * 2); left.setBottom(toolbar); } diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index 19f9cc3d5..67644922c 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -127,7 +127,7 @@ } .advanced-list-box-content { - -fx-padding: 18 0 0 0; + -fx-padding: 12 0 12 0; -fx-spacing: 0; } @@ -774,7 +774,7 @@ } .card { - -fx-background-color: WHITE; + -fx-background-color: rgba(255, 255, 255, 0.8); -fx-background-radius: 4; -fx-padding: 8px; }