Skip to content

Commit e540e5a

Browse files
committed
Fix Windows font bug
1 parent 1e25a05 commit e540e5a

File tree

3 files changed

+24
-33
lines changed

3 files changed

+24
-33
lines changed

ui/src/main/java/edu/wpi/grip/ui/AboutDialogController.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package edu.wpi.grip.ui;
22

33
import javafx.fxml.FXML;
4+
import javafx.scene.control.Label;
45
import javafx.scene.input.MouseEvent;
5-
import javafx.scene.text.Text;
66

77
import javax.inject.Inject;
88

@@ -12,7 +12,7 @@ public class AboutDialogController {
1212
private Main main;
1313

1414
@FXML
15-
private Text versionNumberText;
15+
private Label versionNumberLabel;
1616

1717
@FXML
1818
void mousePressedDocumentationButton(MouseEvent event) {
@@ -26,9 +26,9 @@ void mousePressedGithubButton(MouseEvent event) {
2626

2727
@FXML
2828
void initialize() {
29-
assert versionNumberText != null : "fx:id=\"versionNumberText\" was not injected: check your FXML file 'AboutDialog.fxml'.";
29+
assert versionNumberLabel != null : "fx:id=\"versionNumberText\" was not injected: check your FXML file 'AboutDialog.fxml'.";
3030

31-
versionNumberText.setText("Version " + edu.wpi.grip.core.Main.class.getPackage().getImplementationVersion());
31+
versionNumberLabel.setText("Version " + edu.wpi.grip.core.Main.class.getPackage().getImplementationVersion());
3232
}
3333
}
3434

ui/src/main/resources/edu/wpi/grip/ui/AboutDialog.fxml

Lines changed: 14 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22

3+
<?import java.net.URL?>
34
<?import javafx.geometry.Insets?>
5+
<?import javafx.scene.control.Label?>
46
<?import javafx.scene.image.Image?>
57
<?import javafx.scene.image.ImageView?>
68
<?import javafx.scene.layout.HBox?>
79
<?import javafx.scene.layout.Pane?>
810
<?import javafx.scene.layout.StackPane?>
911
<?import javafx.scene.layout.VBox?>
1012
<?import javafx.scene.text.Font?>
11-
<?import javafx.scene.text.Text?>
1213

13-
<VBox fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity"
14-
prefHeight="330.0" prefWidth="600.0" stylesheets="@GRIP.css" xmlns="http://javafx.com/javafx/8.0.65"
15-
xmlns:fx="http://javafx.com/fxml/1" fx:controller="edu.wpi.grip.ui.AboutDialogController">
14+
<VBox fx:id="root" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="330.0" prefWidth="600.0" styleClass="about-window" stylesheets="@GRIP.css" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="edu.wpi.grip.ui.AboutDialogController">
1615
<children>
1716
<Pane VBox.vgrow="ALWAYS" />
1817
<HBox>
@@ -26,26 +25,17 @@
2625
<Pane HBox.hgrow="ALWAYS" />
2726
<VBox HBox.hgrow="ALWAYS">
2827
<children>
29-
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="GRIP">
30-
<font>
31-
<Font name="Roboto Bold" size="64.0" />
32-
</font>
33-
</Text>
34-
<Text fx:id="versionNumberText" strokeType="OUTSIDE" strokeWidth="0.0" text="Version 0.0.0">
35-
<font>
36-
<Font name="Roboto Regular" size="14.0" />
37-
</font>
38-
</Text>
28+
<Label style="-fx-font-size: 64; -fx-font-weight: BOLD;" text="GRIP" />
29+
<Label fx:id="versionNumberLabel" text="Version 0.0.0" />
3930
<Pane VBox.vgrow="ALWAYS" />
4031
<HBox>
4132
<children>
4233
<StackPane onMousePressed="#mousePressedGithubButton" styleClass="about-button">
4334
<children>
44-
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="➔ Github">
35+
<Label text="➔ Github">
4536
<font>
46-
<Font name="Roboto Regular" size="14.0" />
47-
</font>
48-
</Text>
37+
<Font size="14.0" />
38+
</font></Label>
4939
</children>
5040
<opaqueInsets>
5141
<Insets />
@@ -64,11 +54,7 @@
6454
<children>
6555
<StackPane onMousePressed="#mousePressedDocumentationButton" styleClass="about-button">
6656
<children>
67-
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="➔ ScreenSteps Documentation">
68-
<font>
69-
<Font name="Roboto Regular" size="14.0" />
70-
</font>
71-
</Text>
57+
<Label text="➔ ScreenSteps Documentation" />
7258
</children>
7359
<HBox.margin>
7460
<Insets left="-3.0" />
@@ -92,15 +78,16 @@
9278
<HBox>
9379
<children>
9480
<Pane HBox.hgrow="ALWAYS" />
95-
<Text fill="#818181" strokeType="OUTSIDE" strokeWidth="0.0" text="GRIP is licensed under a 3 Clause BSD License">
96-
<font>
97-
<Font name="Roboto Regular" size="12.0" />
98-
</font></Text>
81+
<Label style="-fx-font-size: 12;" text="GRIP is licensed under a 3 Clause BSD License" textFill="#818181" />
9982
<Pane HBox.hgrow="ALWAYS" />
10083
</children>
10184
<padding>
10285
<Insets bottom="5.0" left="5.0" right="5.0" top="5.0" />
10386
</padding>
10487
</HBox>
10588
</children>
89+
<stylesheets>
90+
<URL value="@roboto/Roboto.css" />
91+
<URL value="@GRIP.css" />
92+
</stylesheets>
10693
</VBox>

ui/src/main/resources/edu/wpi/grip/ui/GRIP.css

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,16 @@ VBox.sockets {
235235
-fx-font-weight: bold;
236236
}
237237

238+
.about-window Label {
239+
-fx-font-size: 14;
240+
}
241+
238242
.about-button:hover {
239243
-fx-background-color: gray;
240244
-fx-background-radius: 12;
241245
-fx-cursor: hand;
242246
}
243247

244-
.about-button:hover Text {
245-
-fx-fill: white;
248+
.about-button:hover Label {
249+
-fx-text-fill: white;
246250
}

0 commit comments

Comments
 (0)