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;
@FXML
private Text titleText;
private Label titleText;
@FXML
private Button refreshButton;
@FXML
private Text descriptionText;
private Label descriptionText;
@FXML
private Text startDateText;
private Label startDateText;
@FXML
private Text endDateText;
private Label endDateText;
@FXML
private Button confirmButton;

View File

@ -14,110 +14,117 @@
<?import javafx.scene.layout.VBox?>
<?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">
<left>
<VBox prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER">
<children>
<Button fx:id="newButton" mnemonicParsing="false" text="new" textAlignment="CENTER">
<VBox.margin>
<Insets bottom="5.0" left="30.0" top="5.0" />
</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>
<BorderPane prefHeight="500.0" prefWidth="800.0"
xmlns="http://javafx.com/javafx/17"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="dev.ksan.ui.OrganizerController"
style="-fx-background-color: #f4f6f8;">
<!-- TOP BAR -->
<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>
<Label fx:id="usernameLabel" text="teemp" textAlignment="CENTER">
<HBox.margin>
<Insets left="20.0" top="5.0" />
</HBox.margin>
</Label>
<Label fx:id="usernameLabel"
text="Username"
style="-fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;"/>
</children>
</HBox>
</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>
<StackPane fx:id="centerPane" prefHeight="150.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<StackPane style="-fx-padding: 20;">
<children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Title:" />
<TextField fx:id="titleField" />
</children>
<VBox spacing="15" maxWidth="500"
style="-fx-background-color: white; -fx-padding: 20; -fx-background-radius: 10; -fx-border-color: #ddd; -fx-border-radius: 10;">
<Label text="Create Poll"
style="-fx-font-size: 18px; -fx-font-weight: bold;"/>
<!-- 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 prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Description:" />
<TextField fx:id="descriptionField" />
</children>
</VBox>
<!-- TIME -->
<VBox spacing="5">
<Label text="Time Range"/>
<HBox spacing="10">
<TextField fx:id="startTimeField" promptText="HH:mm"/>
<Label text="→"/>
<TextField fx:id="endTimeField" promptText="HH:mm"/>
</HBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<DatePicker fx:id="startDatePicker" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="&lt;---&gt;">
<HBox.margin>
<Insets top="3.0" />
</HBox.margin>
</Text>
<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">
</VBox>
<!-- OPTIONS -->
<VBox spacing="10">
<HBox spacing="10" alignment="CENTER_LEFT">
<Label text="Options"/>
<Button fx:id="newOptionButton" text="+ Add"/>
</HBox>
<ScrollPane fitToWidth="true" VBox.vgrow="ALWAYS">
<content>
<HBox>
<children>
<Button fx:id="newOptionButton" mnemonicParsing="false" text="new" />
<VBox fx:id="optionsContainer" alignment="CENTER" />
</children>
</HBox>
<VBox fx:id="optionsContainer" spacing="8"/>
</content>
</ScrollPane>
<Button fx:id="confirmButton" alignment="BOTTOM_RIGHT" mnemonicParsing="false" text="create">
<graphic>
<Label fx:id="errorLabel" text="Label" />
</graphic>
</Button>
</children>
</VBox>
<!-- ERROR -->
<Label fx:id="errorLabel"
style="-fx-text-fill: red;"/>
<!-- ACTION -->
<Button fx:id="confirmButton"
text="Create Poll"
style="-fx-background-color: #2ecc71; -fx-text-fill: white; -fx-font-weight: bold;"/>
</VBox>
</children>
</StackPane>
</center>
</BorderPane>

View File

@ -12,96 +12,105 @@
<?import javafx.scene.layout.VBox?>
<?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">
<left>
<VBox prefHeight="200.0" prefWidth="250.0" BorderPane.alignment="CENTER">
<children>
<ScrollPane prefHeight="200.0" prefWidth="200.0" VBox.vgrow="ALWAYS">
<content>
<VBox fx:id="panesBox">
<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>
<BorderPane prefHeight="500.0" prefWidth="800.0"
xmlns="http://javafx.com/javafx/23.0.1"
xmlns:fx="http://javafx.com/fxml/1"
fx:controller="dev.ksan.ui.VoterController"
style="-fx-background-color: #f4f6f8;">
<!-- TOP BAR -->
<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>
<Label fx:id="usernameLabel" text="teemp" textAlignment="CENTER">
<HBox.margin>
<Insets left="20.0" top="5.0" />
</HBox.margin>
</Label>
<Label fx:id="usernameLabel"
text="Username"
style="-fx-text-fill: white; -fx-font-size: 16px; -fx-font-weight: bold;"/>
</children>
</HBox>
</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>
<StackPane fx:id="centerPane" prefHeight="150.0" prefWidth="200.0" BorderPane.alignment="CENTER">
<StackPane fx:id="centerPane" style="-fx-padding: 20;">
<children>
<VBox alignment="CENTER" prefHeight="200.0" prefWidth="100.0">
<children>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Title:" />
<Text fx:id="titleText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" />
</children>
</HBox>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="Description:" />
<Text fx:id="descriptionText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" />
</children>
</HBox>
<VBox prefHeight="200.0" prefWidth="100.0">
<children>
<HBox prefHeight="100.0" prefWidth="200.0">
<children>
<Text fx:id="startDateText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" />
<Text strokeType="OUTSIDE" strokeWidth="0.0" text="&lt;---&gt;">
<HBox.margin>
<Insets top="3.0" />
</HBox.margin>
</Text>
<Text fx:id="endDateText" strokeType="OUTSIDE" strokeWidth="0.0" text="Text" />
</children>
</HBox>
</children>
</VBox>
<ScrollPane VBox.vgrow="ALWAYS">
<VBox spacing="15" maxWidth="500"
style="-fx-background-color: white; -fx-padding: 20; -fx-background-radius: 10; -fx-border-radius: 10; -fx-border-color: #ddd;">
<!-- TITLE -->
<Label text="Poll Details"
style="-fx-font-size: 18px; -fx-font-weight: bold;"/>
<!-- TITLE FIELD -->
<HBox spacing="10">
<Label text="Title:" style="-fx-font-weight: bold;"/>
<Label fx:id="titleText"/>
</HBox>
<!-- DESCRIPTION -->
<HBox spacing="10">
<Label text="Description:" style="-fx-font-weight: bold;"/>
<Label fx:id="descriptionText" wrapText="true"/>
</HBox>
<!-- DATES -->
<HBox spacing="10">
<Label text="Duration:" style="-fx-font-weight: bold;"/>
<Label fx:id="startDateText"/>
<Label text="→"/>
<Label fx:id="endDateText"/>
</HBox>
<!-- OPTIONS -->
<VBox spacing="10">
<Label text="Options:" style="-fx-font-weight: bold;"/>
<ScrollPane fitToWidth="true" VBox.vgrow="ALWAYS">
<content>
<HBox>
<children>
<VBox fx:id="optionsContainer" alignment="CENTER" />
</children>
</HBox>
<VBox fx:id="optionsContainer" spacing="8"/>
</content>
</ScrollPane>
<Label fx:id="alreadyVotedLabel" text="Label" />
<Label fx:id="errorLabel" text="Label" />
<Button fx:id="confirmButton" alignment="BOTTOM_RIGHT" mnemonicParsing="false" text="create" />
</children>
</VBox>
<!-- STATUS -->
<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>
</children>
</StackPane>
</center>
</BorderPane>