From 80f79d20a5f7bda7f19c1b40af5734b02441c909 Mon Sep 17 00:00:00 2001 From: huanghongxun Date: Mon, 24 Sep 2018 17:26:02 +0800 Subject: [PATCH] Update message UI --- .../main/java/org/jackhuang/hmcl/ui/MainPage.java | 3 +++ .../hmcl/ui/construct/TwoLineListItem.java | 3 +++ HMCL/src/main/resources/assets/css/root.css | 6 ++++++ HMCL/src/main/resources/assets/fxml/main.fxml | 14 ++++++++++---- 4 files changed, 22 insertions(+), 4 deletions(-) diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/MainPage.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/MainPage.java index 27226a603..d96fdf6ce 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/MainPage.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/MainPage.java @@ -78,6 +78,8 @@ public final class MainPage extends StackPane implements DecoratorPage { @FXML private Label lblCurrentGame; @FXML + private Label lblIcon; + @FXML private TwoLineListItem lblLatestVersion; @FXML private Rectangle separator; @@ -106,6 +108,7 @@ public final class MainPage extends StackPane implements DecoratorPage { })); nowAnimation.play(); }); + lblIcon.setGraphic(SVG.update(Theme.whiteFillBinding(), 20, 20)); updateListener = any -> { if (UpdateChecker.isOutdated()) { lblLatestVersion.setTitle(i18n("update.bubble.title", UpdateChecker.getLatestVersion().getVersion())); diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java index 1ad0406c5..eff237292 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/construct/TwoLineListItem.java @@ -33,6 +33,7 @@ import java.util.Collections; import java.util.List; public class TwoLineListItem extends StackPane { + private static final String DEFAULT_STYLE_CLASS = "two-line-list-item"; private final StringProperty title = new SimpleStringProperty(this, "title"); private final StringProperty subtitle = new SimpleStringProperty(this, "subtitle"); @@ -64,6 +65,8 @@ public class TwoLineListItem extends StackPane { VBox vbox = new VBox(); vbox.getChildren().setAll(lblTitle, lblSubtitle); getChildren().setAll(vbox); + + getStyleClass().add(DEFAULT_STYLE_CLASS); } public String getTitle() { diff --git a/HMCL/src/main/resources/assets/css/root.css b/HMCL/src/main/resources/assets/css/root.css index b06683d03..9228a13a6 100644 --- a/HMCL/src/main/resources/assets/css/root.css +++ b/HMCL/src/main/resources/assets/css/root.css @@ -98,6 +98,12 @@ -fx-text-fill: white; } +.two-line-list-item { + -jfx-title-font-size: 15px; + -jfx-title-fill: black; + -jfx-subtitle-fill: gray; +} + /******************************************************************************* * * * JFX Tab Pane * diff --git a/HMCL/src/main/resources/assets/fxml/main.fxml b/HMCL/src/main/resources/assets/fxml/main.fxml index 42d86a676..ce0900a0b 100644 --- a/HMCL/src/main/resources/assets/fxml/main.fxml +++ b/HMCL/src/main/resources/assets/fxml/main.fxml @@ -8,23 +8,29 @@ + - + + - + +