Icons
This commit is contained in:
parent
127a0761c8
commit
b5fb194c08
@ -15,6 +15,7 @@ import javafx.fxml.FXMLLoader;
|
|||||||
import javafx.scene.Scene;
|
import javafx.scene.Scene;
|
||||||
import javafx.scene.control.Button;
|
import javafx.scene.control.Button;
|
||||||
import javafx.scene.image.Image;
|
import javafx.scene.image.Image;
|
||||||
|
import javafx.scene.image.ImageView;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.scene.layout.Pane;
|
||||||
import javafx.scene.shape.Rectangle;
|
import javafx.scene.shape.Rectangle;
|
||||||
import javafx.stage.Stage;
|
import javafx.stage.Stage;
|
||||||
@ -27,6 +28,8 @@ public class Main extends Application {
|
|||||||
|
|
||||||
private double xOffset = 0, yOffset = 0; // Offsets for dragging
|
private double xOffset = 0, yOffset = 0; // Offsets for dragging
|
||||||
private Button exit, min, Home_btn, Modpack_btn; // Define buttons
|
private Button exit, min, Home_btn, Modpack_btn; // Define buttons
|
||||||
|
private ImageView icon;
|
||||||
|
private Image appIcon;
|
||||||
private Rectangle dragBar; // Draggable top bar
|
private Rectangle dragBar; // Draggable top bar
|
||||||
private Pane root, tab;
|
private Pane root, tab;
|
||||||
private Tabs activeTab = Tabs.Home;
|
private Tabs activeTab = Tabs.Home;
|
||||||
@ -41,7 +44,7 @@ public class Main extends Application {
|
|||||||
primaryStage.setScene(new Scene(root, 900, 500));
|
primaryStage.setScene(new Scene(root, 900, 500));
|
||||||
primaryStage.show();
|
primaryStage.show();
|
||||||
primaryStage.getIcons().clear();
|
primaryStage.getIcons().clear();
|
||||||
primaryStage.getIcons().add(new Image(getClass().getResourceAsStream("../assets/icons/app.png")));
|
primaryStage.getIcons().add(appIcon = new Image(getClass().getResourceAsStream("../assets/icons/app.png")));
|
||||||
|
|
||||||
// Field initialization
|
// Field initialization
|
||||||
exit = (Button) root.lookup("#exit");
|
exit = (Button) root.lookup("#exit");
|
||||||
@ -50,6 +53,7 @@ public class Main extends Application {
|
|||||||
Home_btn = (Button) root.lookup("#Home-btn");
|
Home_btn = (Button) root.lookup("#Home-btn");
|
||||||
Modpack_btn = (Button) root.lookup("#Modpacks-btn");
|
Modpack_btn = (Button) root.lookup("#Modpacks-btn");
|
||||||
tab = (Pane) root.lookup("#tab");
|
tab = (Pane) root.lookup("#tab");
|
||||||
|
icon = (ImageView) root.lookup("#icon");
|
||||||
|
|
||||||
|
|
||||||
// Infrastructural navigation
|
// Infrastructural navigation
|
||||||
@ -72,6 +76,7 @@ public class Main extends Application {
|
|||||||
|
|
||||||
// Set up default layout
|
// Set up default layout
|
||||||
Tabs.Home.switchTab(tab);
|
Tabs.Home.switchTab(tab);
|
||||||
|
icon.setImage(appIcon);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@ -6,11 +6,13 @@
|
|||||||
<?import javafx.scene.shape.Rectangle?>
|
<?import javafx.scene.shape.Rectangle?>
|
||||||
<?import javafx.scene.text.Font?>
|
<?import javafx.scene.text.Font?>
|
||||||
|
|
||||||
|
<?import javafx.scene.image.ImageView?>
|
||||||
<Pane id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500" prefWidth="900" stylesheets="@../style/nav.css" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1">
|
<Pane id="pane" maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="500" prefWidth="900" stylesheets="@../style/nav.css" xmlns="http://javafx.com/javafx/8.0.112-ea" xmlns:fx="http://javafx.com/fxml/1">
|
||||||
<children>
|
<children>
|
||||||
<Rectangle id="rectangle" arcHeight="5.0" arcWidth="5.0" fill="white" height="50.0" strokeType="INSIDE" width="900.0" />
|
<Rectangle id="rectangle" arcHeight="5.0" arcWidth="5.0" fill="white" height="50.0" strokeType="INSIDE" width="900.0" />
|
||||||
<Button id="exit" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="862.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../style/nav.css" text="X" textFill="WHITE" />
|
<Button id="exit" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="862.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../style/nav.css" text="X" textFill="WHITE" />
|
||||||
<Button id="min" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="841.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../style/nav.css" text="-" textFill="WHITE" />
|
<Button id="min" alignment="TOP_RIGHT" contentDisplay="RIGHT" layoutX="841.0" layoutY="13.0" mnemonicParsing="false" stylesheets="@../style/nav.css" text="-" textFill="WHITE" />
|
||||||
|
<ImageView fitWidth="30" fitHeight="30" layoutX="10" layoutY="11" id="icon" />
|
||||||
<Label layoutX="46.0" layoutY="11.0" text="Team-Avion Launcher" textFill="WHITE">
|
<Label layoutX="46.0" layoutY="11.0" text="Team-Avion Launcher" textFill="WHITE">
|
||||||
<font>
|
<font>
|
||||||
<Font name="Centaur" size="24.0" />
|
<Font name="Centaur" size="24.0" />
|
||||||
|
Loading…
x
Reference in New Issue
Block a user