Chnaged things

This commit is contained in:
Michael-Jouanneau 2016-10-30 17:08:54 +01:00
parent 14280421da
commit d1eaa3298c
4 changed files with 14 additions and 7 deletions

View File

@ -21,13 +21,14 @@ import javafx.scene.shape.Rectangle;
import javafx.stage.Stage; import javafx.stage.Stage;
import javafx.stage.StageStyle; import javafx.stage.StageStyle;
import java.net.URL; import java.net.URL;
import java.util.Set;
public class Main extends Application { public class Main extends Application {
public static final URL mainLauncher = Main.class.getResource("../assets/layout/main.fxml"); // Launcher body public static final URL mainLauncher = Main.class.getResource("../assets/layout/main.fxml"); // Launcher body
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, Settings_btn; // Define buttons
private ImageView icon; private ImageView icon;
private Image appIcon; private Image appIcon;
private Rectangle dragBar; // Draggable top bar private Rectangle dragBar; // Draggable top bar
@ -52,6 +53,7 @@ public class Main extends Application {
dragBar = (Rectangle) root.lookup("#rectangle"); dragBar = (Rectangle) root.lookup("#rectangle");
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");
Settings_btn = (Button) root.lookup("#Settings-btn");
tab = (Pane) root.lookup("#tab"); tab = (Pane) root.lookup("#tab");
icon = (ImageView) root.lookup("#icon"); icon = (ImageView) root.lookup("#icon");
@ -61,7 +63,7 @@ public class Main extends Application {
min.setOnMouseClicked(event -> primaryStage.setIconified(true)); // Minimizes the program if minimize button is clicked min.setOnMouseClicked(event -> primaryStage.setIconified(true)); // Minimizes the program if minimize button is clicked
Home_btn.setOnMouseClicked(event -> {if(activeTab!=Tabs.Home)(activeTab=Tabs.Home).switchTab(tab);}); // Sets the active tab to the home tab unless it's already active Home_btn.setOnMouseClicked(event -> {if(activeTab!=Tabs.Home)(activeTab=Tabs.Home).switchTab(tab);}); // Sets the active tab to the home tab unless it's already active
Modpack_btn.setOnMouseClicked(event -> {if(activeTab!=Tabs.Modpacks)(activeTab=Tabs.Modpacks).switchTab(tab);});// Sets the active tab to the modpacks tab unless it's already active Modpack_btn.setOnMouseClicked(event -> {if(activeTab!=Tabs.Modpacks)(activeTab=Tabs.Modpacks).switchTab(tab);});// Sets the active tab to the modpacks tab unless it's already active
Settings_btn.setOnMouseClicked(event -> {if(activeTab!=Tabs.Settings)(activeTab=Tabs.Settings).switchTab(tab);});
// Drag // Drag
dragBar.setOnMousePressed(event -> { dragBar.setOnMousePressed(event -> {

View File

@ -8,7 +8,7 @@ import java.net.URL;
public enum Tabs { public enum Tabs {
Modpacks(Main.class.getResource("../assets/layout/modpacks.fxml")), Home(Main.class.getResource("../assets/layout/home.fxml")); Modpacks(Main.class.getResource("../assets/layout/modpacks.fxml")), Home(Main.class.getResource("../assets/layout/home.fxml")), Settings(Main.class.getResource("../assets/layout/settings.fxml"));
public final URL url; public final URL url;
private Parent loaded; private Parent loaded;

View File

@ -19,16 +19,21 @@
</font> </font>
</Label> </Label>
<Rectangle id="nav" arcHeight="5.0" arcWidth="5.0" fill="#101e38" height="450.0" layoutY="50.0" stroke="TRANSPARENT" strokeType="INSIDE" width="150.0" /> <Rectangle id="nav" arcHeight="5.0" arcWidth="5.0" fill="#101e38" height="450.0" layoutY="50.0" stroke="TRANSPARENT" strokeType="INSIDE" width="150.0" />
<Button id="Home-btn" layoutY="50.0" mnemonicParsing="false" prefHeight="39.0" prefWidth="150.0" text="Home" textFill="WHITE" textOverrun="CLIP"> <Button id="Home-btn" layoutY="50.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="150.0" text="Home" textFill="WHITE" textOverrun="CLIP">
<font> <font>
<Font name="Centaur" size="16.0" /> <Font name="Centaur" size="16.0" />
</font> </font>
</Button> </Button>
<Button id="Modpacks-btn" layoutY="89.0" mnemonicParsing="false" prefHeight="39.0" prefWidth="150.0" text="Modpack" textFill="WHITE" textOverrun="CLIP"> <Button id="Modpacks-btn" layoutY="90.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="150.0" text="Modpack" textFill="WHITE" textOverrun="CLIP">
<font> <font>
<Font name="Centaur" size="16.0" /> <Font name="Centaur" size="16.0" />
</font> </font>
</Button> </Button>
<Button id="Settings-btn" layoutY="130.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="150.0" text="Settings" textFill="WHITE" textOverrun="CLIP">
<font>
<Font name="Centaur" size="16.0" />
</font>
</Button>
<Pane id="tab" layoutX="150.0" layoutY="50.0" prefHeight="450.0" prefWidth="750.0" /> <Pane id="tab" layoutX="150.0" layoutY="50.0" prefHeight="450.0" prefWidth="750.0" />
<Label layoutX="26.0" layoutY="455.0" text="Version : Dev-0.0.1" textFill="white" /> <Label layoutX="26.0" layoutY="455.0" text="Version : Dev-0.0.1" textFill="white" />
<Label layoutX="9.0" layoutY="472.0" text="Copyright 2016 TeamAvion" textFill="WHITE"> <Label layoutX="9.0" layoutY="472.0" text="Copyright 2016 TeamAvion" textFill="WHITE">

View File

@ -10,10 +10,10 @@
#min:hover, #exit:hover{ #min:hover, #exit:hover{
-fx-background-color: #bf0000; -fx-background-color: #bf0000;
} }
#Home-btn, #Modpacks-btn { #Home-btn, #Modpacks-btn, #Settings-btn {
-fx-background-color: rgba(0, 0, 0, 0); -fx-background-color: rgba(0, 0, 0, 0);
} }
#Home-btn:hover, #Modpacks-btn:hover { #Home-btn:hover, #Modpacks-btn:hover, #Settings-btn:hover {
-fx-background-color: #0c182d; -fx-background-color: #0c182d;
-fx-background-radius: 0em; -fx-background-radius: 0em;
} }