From 15d329a5f0166317565d1fa281d2298cc98b9b10 Mon Sep 17 00:00:00 2001
From: Robert Goldmann <deadlocker@gmx.de>
Date: Fri, 26 May 2017 18:25:08 +0200
Subject: [PATCH] Fixed #8  - make resizeable

---
 src/userInterface/Main.java                   |  5 +-
 .../UserInterfaceController.java              |  4 +
 src/userInterface/userInterface.fxml          | 95 ++++++++++++-------
 3 files changed, 67 insertions(+), 37 deletions(-)

diff --git a/src/userInterface/Main.java b/src/userInterface/Main.java
index 0026e30..99879c8 100644
--- a/src/userInterface/Main.java
+++ b/src/userInterface/Main.java
@@ -30,8 +30,11 @@ public class Main extends Application
 			Parent root = (Parent)loader.load();
 
 			Scene scene = new Scene(root, 800, 800);
+			
+			stage.setMinHeight(500);
+			stage.setMinWidth(700);
 
-			stage.setResizable(false);
+			stage.setResizable(true);
 			stage.setTitle("SmartTime");
 			stage.setScene(scene);
 			
diff --git a/src/userInterface/UserInterfaceController.java b/src/userInterface/UserInterfaceController.java
index 173ace1..c121a59 100644
--- a/src/userInterface/UserInterfaceController.java
+++ b/src/userInterface/UserInterfaceController.java
@@ -75,6 +75,7 @@ public class UserInterfaceController
 	@FXML private ToggleButton startButton;
 	@FXML private TableView<LogObject> table;
 	@FXML private ScrollPane scrollPane;
+	@FXML private Label labelSeparator;
 
 	private Stage stage;
 	private core.Counter stoppUhr;
@@ -97,6 +98,9 @@ public class UserInterfaceController
 	{		
 	    this.stage = stage;
 	    
+	    labelSeparator.setStyle("-fx-background-color: #cdc6c6; -fx-font-size: 0.7");
+//	    labelSeparator.setMaxHeight(1.5);
+	    
 		PathUtils.checkFolder(new File(new File(savePath).getParent()));
 		icon = new Image("/userInterface/icon.png");
 
diff --git a/src/userInterface/userInterface.fxml b/src/userInterface/userInterface.fxml
index 7cb9dce..71f206b 100644
--- a/src/userInterface/userInterface.fxml
+++ b/src/userInterface/userInterface.fxml
@@ -12,14 +12,13 @@
 <?import javafx.scene.control.TitledPane?>
 <?import javafx.scene.control.ToggleButton?>
 <?import javafx.scene.layout.AnchorPane?>
-<?import javafx.scene.layout.Pane?>
+<?import javafx.scene.layout.HBox?>
 <?import javafx.scene.layout.VBox?>
-<?import javafx.scene.shape.Line?>
 <?import javafx.scene.text.Font?>
 
-<AnchorPane prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.65" xmlns:fx="http://javafx.com/fxml/1" fx:controller="userInterface.UserInterfaceController">
+<AnchorPane prefHeight="800.0" prefWidth="800.0" xmlns="http://javafx.com/javafx/8.0.60" xmlns:fx="http://javafx.com/fxml/1" fx:controller="userInterface.UserInterfaceController">
    <children>
-      <VBox layoutX="143.0" layoutY="69.0" prefHeight="800.0" prefWidth="650.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
+      <VBox alignment="TOP_CENTER" layoutX="143.0" layoutY="69.0" prefHeight="800.0" prefWidth="650.0" AnchorPane.bottomAnchor="0.0" AnchorPane.leftAnchor="0.0" AnchorPane.rightAnchor="0.0" AnchorPane.topAnchor="0.0">
          <children>
             <MenuBar>
               <menus>
@@ -48,60 +47,84 @@
                   </Menu>
               </menus>
             </MenuBar>
-            <Pane prefHeight="121.0" prefWidth="650.0">
+            <HBox alignment="CENTER" spacing="30.0">
                <children>
-                  <Label layoutX="48.0" layoutY="25.0" text="aktuelles Projekt:">
-                     <font>
-                        <Font name="System Bold" size="18.0" />
-                     </font>
-                  </Label>
-                  <Label layoutX="48.0" layoutY="73.0" text="aktuelle Aufgabe:">
-                     <font>
-                        <Font name="System Bold" size="18.0" />
-                     </font>
-                  </Label>
-                  <Button layoutX="613.0" layoutY="67.0" mnemonicParsing="false" onAction="#openProjectGUI" prefHeight="39.0" prefWidth="107.0" text="Ändern">
+                  <VBox spacing="30.0" HBox.hgrow="ALWAYS">
+                     <children>
+                        <HBox spacing="30.0">
+                           <children>
+                              <Label text="aktuelles Projekt:">
+                                 <font>
+                                    <Font name="System Bold" size="18.0" />
+                                 </font>
+                              </Label>
+                              <Label fx:id="aktuellesProjektAusgabe" maxWidth="1.7976931348623157E308" text=" " HBox.hgrow="ALWAYS">
+                                 <font>
+                                    <Font size="18.0" />
+                                 </font>
+                              </Label>
+                           </children>
+                        </HBox>
+                        <HBox spacing="30.0">
+                           <children>
+                              <Label text="aktuelle Aufgabe:">
+                                 <font>
+                                    <Font name="System Bold" size="18.0" />
+                                 </font>
+                              </Label>
+                              <Label fx:id="aktuellerTaskAusgabe" maxWidth="1.7976931348623157E308" text=" " HBox.hgrow="ALWAYS">
+                                 <font>
+                                    <Font size="18.0" />
+                                 </font>
+                              </Label>
+                           </children>
+                        </HBox>
+                     </children>
+                  </VBox>
+                  <Button minHeight="40.0" mnemonicParsing="false" onAction="#openProjectGUI" prefHeight="40.0" prefWidth="107.0" text="Ändern">
                      <font>
                         <Font size="16.0" />
                      </font>
                   </Button>
-                  <Label fx:id="aktuellesProjektAusgabe" layoutX="239.0" layoutY="25.0" text=" ">
-                     <font>
-                        <Font size="18.0" />
-                     </font>
-                  </Label>
-                  <Label fx:id="aktuellerTaskAusgabe" layoutX="239.0" layoutY="73.0" text=" ">
-                     <font>
-                        <Font size="18.0" />
-                     </font>
-                  </Label>
                </children>
-            </Pane>
-            <Line endX="790.0" fill="BLACK" stroke="#cdc6c6" strokeWidth="1.5" translateX="5.0">
                <VBox.margin>
-                  <Insets top="10.0" />
+                  <Insets bottom="30.0" left="30.0" right="30.0" top="30.0" />
                </VBox.margin>
-            </Line>
-            <Pane prefHeight="100.0" prefWidth="652.0">
+            </HBox>
+            <HBox>
                <children>
-                  <ToggleButton fx:id="startButton" layoutX="49.0" layoutY="23.0" mnemonicParsing="false" prefHeight="49.0" prefWidth="116.0" text="Start">
+                  <Label fx:id="labelSeparator" maxWidth="1.7976931348623157E308" HBox.hgrow="ALWAYS" />
+               </children>
+               <padding>
+                  <Insets left="10.0" right="10.0" />
+               </padding>
+            </HBox>
+            <HBox alignment="CENTER" spacing="50.0">
+               <children>
+                  <ToggleButton fx:id="startButton" minHeight="40.0" mnemonicParsing="false" prefHeight="40.0" prefWidth="116.0" text="Start">
                      <font>
                         <Font size="16.0" />
                      </font>
                   </ToggleButton>
-                  <Label fx:id="labelTime" layoutX="240.0" layoutY="23.0" prefHeight="49.0" prefWidth="326.0" text=" ">
+                  <Label fx:id="labelTime" alignment="CENTER" contentDisplay="CENTER" maxWidth="1.7976931348623157E308" prefHeight="49.0" prefWidth="326.0" textAlignment="CENTER" HBox.hgrow="ALWAYS">
                      <font>
                         <Font name="Arial" size="28.0" />
                      </font>
                   </Label>
-                  <Button layoutX="614.0" layoutY="30.0" mnemonicParsing="false" onAction="#charts" prefHeight="40.0" prefWidth="107.0" text="Diagramme">
+                  <Button minHeight="40.0" mnemonicParsing="false" onAction="#charts" prefHeight="40.0" prefWidth="107.0" text="Diagramme">
                      <font>
                         <Font size="15.0" />
                      </font>
                   </Button>
                </children>
-            </Pane>
-            <Accordion fx:id="accordion" prefHeight="516.0" prefWidth="652.0">
+               <VBox.margin>
+                  <Insets bottom="20.0" top="20.0" />
+               </VBox.margin>
+               <padding>
+                  <Insets left="30.0" right="30.0" />
+               </padding>
+            </HBox>
+            <Accordion fx:id="accordion" prefHeight="516.0" prefWidth="652.0" VBox.vgrow="ALWAYS">
               <panes>
                 <TitledPane fx:id="Projekte" animated="false" minHeight="250.0" prefHeight="283.0" prefWidth="652.0" text="Projekte gesamt">
                   <content>
-- 
GitLab