mirror of
https://github.com/HMCL-dev/HMCL.git
synced 2025-09-15 14:56:05 -04:00
Update message UI
This commit is contained in:
parent
1611d11544
commit
80f79d20a5
@ -78,6 +78,8 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
|||||||
@FXML
|
@FXML
|
||||||
private Label lblCurrentGame;
|
private Label lblCurrentGame;
|
||||||
@FXML
|
@FXML
|
||||||
|
private Label lblIcon;
|
||||||
|
@FXML
|
||||||
private TwoLineListItem lblLatestVersion;
|
private TwoLineListItem lblLatestVersion;
|
||||||
@FXML
|
@FXML
|
||||||
private Rectangle separator;
|
private Rectangle separator;
|
||||||
@ -106,6 +108,7 @@ public final class MainPage extends StackPane implements DecoratorPage {
|
|||||||
}));
|
}));
|
||||||
nowAnimation.play();
|
nowAnimation.play();
|
||||||
});
|
});
|
||||||
|
lblIcon.setGraphic(SVG.update(Theme.whiteFillBinding(), 20, 20));
|
||||||
updateListener = any -> {
|
updateListener = any -> {
|
||||||
if (UpdateChecker.isOutdated()) {
|
if (UpdateChecker.isOutdated()) {
|
||||||
lblLatestVersion.setTitle(i18n("update.bubble.title", UpdateChecker.getLatestVersion().getVersion()));
|
lblLatestVersion.setTitle(i18n("update.bubble.title", UpdateChecker.getLatestVersion().getVersion()));
|
||||||
|
@ -33,6 +33,7 @@ import java.util.Collections;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
public class TwoLineListItem extends StackPane {
|
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 title = new SimpleStringProperty(this, "title");
|
||||||
private final StringProperty subtitle = new SimpleStringProperty(this, "subtitle");
|
private final StringProperty subtitle = new SimpleStringProperty(this, "subtitle");
|
||||||
@ -64,6 +65,8 @@ public class TwoLineListItem extends StackPane {
|
|||||||
VBox vbox = new VBox();
|
VBox vbox = new VBox();
|
||||||
vbox.getChildren().setAll(lblTitle, lblSubtitle);
|
vbox.getChildren().setAll(lblTitle, lblSubtitle);
|
||||||
getChildren().setAll(vbox);
|
getChildren().setAll(vbox);
|
||||||
|
|
||||||
|
getStyleClass().add(DEFAULT_STYLE_CLASS);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getTitle() {
|
public String getTitle() {
|
||||||
|
@ -98,6 +98,12 @@
|
|||||||
-fx-text-fill: white;
|
-fx-text-fill: white;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.two-line-list-item {
|
||||||
|
-jfx-title-font-size: 15px;
|
||||||
|
-jfx-title-fill: black;
|
||||||
|
-jfx-subtitle-fill: gray;
|
||||||
|
}
|
||||||
|
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* *
|
* *
|
||||||
* JFX Tab Pane *
|
* JFX Tab Pane *
|
||||||
|
@ -8,23 +8,29 @@
|
|||||||
<?import org.jackhuang.hmcl.ui.FXUtils?>
|
<?import org.jackhuang.hmcl.ui.FXUtils?>
|
||||||
<?import javafx.geometry.Insets?>
|
<?import javafx.geometry.Insets?>
|
||||||
<?import org.jackhuang.hmcl.ui.construct.TwoLineListItem?>
|
<?import org.jackhuang.hmcl.ui.construct.TwoLineListItem?>
|
||||||
|
<?import javafx.scene.layout.HBox?>
|
||||||
<fx:root type="StackPane" pickOnBounds="false"
|
<fx:root type="StackPane" pickOnBounds="false"
|
||||||
xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1">
|
xmlns="http://javafx.com/javafx/8.0.112" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
<StackPane fx:id="main" style="-fx-padding: 25;">
|
<StackPane fx:id="main" style="-fx-padding: 25;">
|
||||||
<StackPane fx:id="updatePane" styleClass="bubble" FXUtils.limitWidth="230" FXUtils.limitHeight="55"
|
<StackPane fx:id="updatePane" styleClass="bubble" FXUtils.limitWidth="230" FXUtils.limitHeight="55"
|
||||||
onMouseClicked="#onUpgrade" StackPane.alignment="TOP_RIGHT">
|
onMouseClicked="#onUpgrade" StackPane.alignment="TOP_RIGHT">
|
||||||
<TwoLineListItem StackPane.alignment="CENTER_LEFT" titleFill="white" subtitleFill="white" subtitle="%update.bubble.subtitle" fx:id="lblLatestVersion" pickOnBounds="false">
|
<HBox StackPane.alignment="CENTER_LEFT" alignment="CENTER_LEFT" spacing="12">
|
||||||
|
<Label fx:id="lblIcon" />
|
||||||
|
<TwoLineListItem titleFill="white" subtitleFill="white" subtitle="%update.bubble.subtitle" fx:id="lblLatestVersion" pickOnBounds="false"
|
||||||
|
style="-jfx-title-font-weight: BOLD;" />
|
||||||
|
|
||||||
<StackPane.margin>
|
<StackPane.margin>
|
||||||
<Insets left="12" top="9" right="12" bottom="9" />
|
<Insets left="16" top="9" right="12" bottom="9" />
|
||||||
</StackPane.margin>
|
</StackPane.margin>
|
||||||
</TwoLineListItem>
|
</HBox>
|
||||||
|
|
||||||
<JFXButton fx:id="closeButton" StackPane.alignment="TOP_RIGHT" styleClass="toggle-icon-tiny">
|
<JFXButton fx:id="closeButton" StackPane.alignment="TOP_RIGHT" styleClass="toggle-icon-tiny">
|
||||||
<StackPane.margin>
|
<StackPane.margin>
|
||||||
<Insets topRightBottomLeft="4" />
|
<Insets topRightBottomLeft="5" />
|
||||||
</StackPane.margin>
|
</StackPane.margin>
|
||||||
</JFXButton>
|
</JFXButton>
|
||||||
</StackPane>
|
</StackPane>
|
||||||
|
|
||||||
<StackPane maxWidth="230" maxHeight="55" StackPane.alignment="BOTTOM_RIGHT">
|
<StackPane maxWidth="230" maxHeight="55" StackPane.alignment="BOTTOM_RIGHT">
|
||||||
<JFXButton prefWidth="230" prefHeight="55" buttonType="RAISED" styleClass="jfx-button-raised"
|
<JFXButton prefWidth="230" prefHeight="55" buttonType="RAISED" styleClass="jfx-button-raised"
|
||||||
onMouseClicked="#launch" fx:id="btnLaunch">
|
onMouseClicked="#launch" fx:id="btnLaunch">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user