changed look a bit

This commit is contained in:
Ksan 2026-04-17 19:45:51 +02:00
parent be2d918620
commit 1df97b4d3f
3 changed files with 190 additions and 174 deletions

View File

@ -44,17 +44,17 @@ public class VoterController {
private StackPane centerPane; private StackPane centerPane;
@FXML @FXML
private Text titleText; private Label titleText;
@FXML @FXML
private Button refreshButton; private Button refreshButton;
@FXML @FXML
private Text descriptionText; private Label descriptionText;
@FXML @FXML
private Text startDateText; private Label startDateText;
@FXML @FXML
private Text endDateText; private Label endDateText;
@FXML @FXML
private Button confirmButton; private Button confirmButton;

View File

@ -14,110 +14,117 @@
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?> <?import javafx.scene.text.Text?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dev.ksan.ui.OrganizerController"> <BorderPane prefHeight="500.0" prefWidth="800.0"
<left> xmlns="http://javafx.com/javafx/17"
<VBox prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER"> xmlns:fx="http://javafx.com/fxml/1"
<children> fx:controller="dev.ksan.ui.OrganizerController"
<Button fx:id="newButton" mnemonicParsing="false" text="new" textAlignment="CENTER"> style="-fx-background-color: #f4f6f8;">
<VBox.margin>
<Insets bottom="5.0" left="30.0" top="5.0" /> <!-- TOP BAR -->
</VBox.margin>
</Button>
<ScrollPane prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<content>
<VBox fx:id="panesBox">
<children>
<TitledPane fx:id="activeList" animated="false" text="untitled" VBox.vgrow="ALWAYS">
<content>
<ListView fx:id="activePollsListView" prefHeight="200.0" prefWidth="200.0" />
</content>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin>
</TitledPane>
<TitledPane fx:id="inactiveList" animated="false" text="untitled" VBox.vgrow="ALWAYS">
<content>
<ListView fx:id="inactivePollsListView" />
</content>
</TitledPane>
</children>
</VBox>
</content>
</ScrollPane>
</children>
<BorderPane.margin>
<Insets />
</BorderPane.margin>
</VBox>
</left>
<top> <top>
<HBox prefHeight="27.0" prefWidth="600.0" BorderPane.alignment="CENTER"> <HBox alignment="CENTER_LEFT" spacing="10"
style="-fx-background-color: #2c3e50; -fx-padding: 10;">
<children> <children>
<Label fx:id="usernameLabel" text="teemp" textAlignment="CENTER"> <Label fx:id="usernameLabel"
<HBox.margin> text="Username"
<Insets left="20.0" top="5.0" /> style="-fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;"/>
</HBox.margin>
</Label>
</children> </children>
</HBox> </HBox>
</top> </top>
<!-- SIDEBAR -->
<left>
<VBox prefWidth="250" spacing="10"
style="-fx-background-color: white; -fx-padding: 10;">
<Button fx:id="newButton"
text=" New Poll"
style="-fx-background-color: #3498db; -fx-text-fill: white;"/>
<TitledPane fx:id="activeList" text="Active Polls" expanded="true">
<content>
<ListView fx:id="activePollsListView"/>
</content>
</TitledPane>
<TitledPane fx:id="inactiveList" text="Inactive Polls">
<content>
<ListView fx:id="inactivePollsListView"/>
</content>
</TitledPane>
</VBox>
</left>
<!-- MAIN CONTENT -->
<center> <center>
<StackPane fx:id="centerPane" prefHeight="150.0" prefWidth="200.0" BorderPane.alignment="CENTER"> <StackPane style="-fx-padding: 20;">
<children> <children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children> <VBox spacing="15" maxWidth="500"
<HBox prefHeight="100.0" prefWidth="200.0"> style="-fx-background-color: white; -fx-padding: 20; -fx-background-radius: 10; -fx-border-color: #ddd; -fx-border-radius: 10;">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Title:" /> <Label text="Create Poll"
<TextField fx:id="titleField" /> style="-fx-font-size: 18px; -fx-font-weight: bold;"/>
</children>
<!-- TITLE -->
<VBox spacing="5">
<Label text="Title"/>
<TextField fx:id="titleField" promptText="Enter title"/>
</VBox>
<!-- DESCRIPTION -->
<VBox spacing="5">
<Label text="Description"/>
<TextField fx:id="descriptionField" promptText="Enter description"/>
</VBox>
<!-- DATE -->
<VBox spacing="5">
<Label text="Date Range"/>
<HBox spacing="10">
<DatePicker fx:id="startDatePicker"/>
<Label text="→"/>
<DatePicker fx:id="endDatePicker"/>
</HBox> </HBox>
<HBox prefHeight="100.0" prefWidth="200.0"> </VBox>
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Description:" /> <!-- TIME -->
<TextField fx:id="descriptionField" /> <VBox spacing="5">
</children> <Label text="Time Range"/>
<HBox spacing="10">
<TextField fx:id="startTimeField" promptText="HH:mm"/>
<Label text="→"/>
<TextField fx:id="endTimeField" promptText="HH:mm"/>
</HBox> </HBox>
<VBox prefHeight="200.0" prefWidth="100.0"> </VBox>
<children>
<HBox prefHeight="100.0" prefWidth="200.0"> <!-- OPTIONS -->
<children> <VBox spacing="10">
<DatePicker fx:id="startDatePicker" /> <HBox spacing="10" alignment="CENTER_LEFT">
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="&lt;---&gt;"> <Label text="Options"/>
<HBox.margin> <Button fx:id="newOptionButton" text="+ Add"/>
<Insets top="3.0" /> </HBox>
</HBox.margin>
</Text> <ScrollPane fitToWidth="true" VBox.vgrow="ALWAYS">
<DatePicker fx:id="endDatePicker" />
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<TextField fx:id="startTimeField" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="&lt;---&gt;" />
<TextField fx:id="endTimeField" />
</children>
</HBox>
</children>
</VBox>
<ScrollPane VBox.vgrow="ALWAYS">
<content> <content>
<HBox> <VBox fx:id="optionsContainer" spacing="8"/>
<children>
<Button fx:id="newOptionButton" mnemonicParsing="false" text="new" />
<VBox fx:id="optionsContainer" alignment="CENTER" />
</children>
</HBox>
</content> </content>
</ScrollPane> </ScrollPane>
<Button fx:id="confirmButton" alignment="BOTTOM_RIGHT" mnemonicParsing="false" text="create"> </VBox>
<graphic>
<Label fx:id="errorLabel" text="Label" /> <!-- ERROR -->
</graphic> <Label fx:id="errorLabel"
</Button> style="-fx-text-fill: red;"/>
</children>
<!-- ACTION -->
<Button fx:id="confirmButton"
text="Create Poll"
style="-fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold;"/>
</VBox> </VBox>
</children> </children>
</StackPane> </StackPane>
</center> </center>
</BorderPane>
</BorderPane>

View File

@ -12,96 +12,105 @@
<?import javafx.scene.layout.VBox?> <?import javafx.scene.layout.VBox?>
<?import javafx.scene.text.Text?> <?import javafx.scene.text.Text?>
<BorderPane maxHeight="-Infinity" maxWidth="-Infinity" minHeight="-Infinity" minWidth="-Infinity" prefHeight="400.0" prefWidth="600.0" xmlns="http://javafx.com/javafx/23.0.1" xmlns:fx="http://javafx.com/fxml/1" fx:controller="dev.ksan.ui.VoterController"> <BorderPane prefHeight="500.0" prefWidth="800.0"
<left> xmlns="http://javafx.com/javafx/23.0.1"
<VBox prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER"> xmlns:fx="http://javafx.com/fxml/1"
<children> fx:controller="dev.ksan.ui.VoterController"
<ScrollPane prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS"> style="-fx-background-color: #f4f6f8;">
<content>
<VBox fx:id="panesBox"> <!-- TOP BAR -->
<children>
<Button fx:id="refreshButton" mnemonicParsing="false" text="Button" />
<TitledPane fx:id="activeList" animated="false" text="untitled" VBox.vgrow="ALWAYS">
<content>
<ListView fx:id="activePollsListView" prefHeight="200.0" prefWidth="200.0" />
</content>
<VBox.margin>
<Insets bottom="5.0" />
</VBox.margin>
</TitledPane>
<TitledPane fx:id="inactiveList" animated="false" text="untitled" VBox.vgrow="ALWAYS">
<content>
<ListView fx:id="inactivePollsListView" />
</content>
</TitledPane>
</children>
</VBox>
</content>
</ScrollPane>
</children>
<BorderPane.margin>
<Insets />
</BorderPane.margin>
</VBox>
</left>
<top> <top>
<HBox prefHeight="27.0" prefWidth="600.0" BorderPane.alignment="CENTER"> <HBox alignment="CENTER_LEFT" spacing="10"
style="-fx-background-color: #2c3e50; -fx-padding: 10;">
<children> <children>
<Label fx:id="usernameLabel" text="teemp" textAlignment="CENTER"> <Label fx:id="usernameLabel"
<HBox.margin> text="Username"
<Insets left="20.0" top="5.0" /> style="-fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;"/>
</HBox.margin>
</Label>
</children> </children>
</HBox> </HBox>
</top> </top>
<!-- SIDEBAR -->
<left>
<VBox prefWidth="260" spacing="10"
style="-fx-background-color: white; -fx-padding: 10;">
<Button fx:id="refreshButton"
text="🔄 Refresh"
style="-fx-background-color: #3498db; -fx-text-fill: white;"/>
<TitledPane fx:id="activeList" text="Active Polls" expanded="true">
<content>
<ListView fx:id="activePollsListView"/>
</content>
</TitledPane>
<TitledPane fx:id="inactiveList" text="Inactive Polls">
<content>
<ListView fx:id="inactivePollsListView"/>
</content>
</TitledPane>
</VBox>
</left>
<!-- MAIN CONTENT -->
<center> <center>
<StackPane fx:id="centerPane" prefHeight="150.0" prefWidth="200.0" BorderPane.alignment="CENTER"> <StackPane fx:id="centerPane" style="-fx-padding: 20;">
<children> <children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children> <VBox spacing="15" maxWidth="500"
<HBox prefHeight="100.0" prefWidth="200.0"> style="-fx-background-color: white; -fx-padding: 20; -fx-background-radius: 10; -fx-border-radius: 10; -fx-border-color: #ddd;">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Title:" /> <!-- TITLE -->
<Text fx:id="titleText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" /> <Label text="Poll Details"
</children> style="-fx-font-size: 18px; -fx-font-weight: bold;"/>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0"> <!-- TITLE FIELD -->
<children> <HBox spacing="10">
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Description:" /> <Label text="Title:" style="-fx-font-weight: bold;"/>
<Text fx:id="descriptionText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" /> <Label fx:id="titleText"/>
</children> </HBox>
</HBox>
<VBox prefHeight="200.0" prefWidth="100.0"> <!-- DESCRIPTION -->
<children> <HBox spacing="10">
<HBox prefHeight="100.0" prefWidth="200.0"> <Label text="Description:" style="-fx-font-weight: bold;"/>
<children> <Label fx:id="descriptionText" wrapText="true"/>
<Text fx:id="startDateText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" /> </HBox>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="&lt;---&gt;">
<HBox.margin> <!-- DATES -->
<Insets top="3.0" /> <HBox spacing="10">
</HBox.margin> <Label text="Duration:" style="-fx-font-weight: bold;"/>
</Text> <Label fx:id="startDateText"/>
<Text fx:id="endDateText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" /> <Label text="→"/>
</children> <Label fx:id="endDateText"/>
</HBox> </HBox>
</children>
</VBox> <!-- OPTIONS -->
<ScrollPane VBox.vgrow="ALWAYS"> <VBox spacing="10">
<Label text="Options:" style="-fx-font-weight: bold;"/>
<ScrollPane fitToWidth="true" VBox.vgrow="ALWAYS">
<content> <content>
<HBox> <VBox fx:id="optionsContainer" spacing="8"/>
<children>
<VBox fx:id="optionsContainer" alignment="CENTER" />
</children>
</HBox>
</content> </content>
</ScrollPane> </ScrollPane>
<Label fx:id="alreadyVotedLabel" text="Label" /> </VBox>
<Label fx:id="errorLabel" text="Label" />
<Button fx:id="confirmButton" alignment="BOTTOM_RIGHT" mnemonicParsing="false" text="create" /> <!-- STATUS -->
</children> <Label fx:id="alreadyVotedLabel"
style="-fx-text-fill: green;"/>
<Label fx:id="errorLabel"
style="-fx-text-fill: red;"/>
<!-- ACTION -->
<Button fx:id="confirmButton"
text="Submit Vote"
style="-fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold;"/>
</VBox> </VBox>
</children> </children>
</StackPane> </StackPane>
</center> </center>
</BorderPane>
</BorderPane>