File tree Expand file tree Collapse file tree 2 files changed +16
-3
lines changed
java/de/doubleslash/keeptime/view Expand file tree Collapse file tree 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 1616
1717package de .doubleslash .keeptime .view ;
1818
19+ import de .doubleslash .keeptime .common .ColorHelper ;
1920import javafx .application .Platform ;
2021import javafx .beans .binding .Bindings ;
2122import javafx .beans .property .BooleanProperty ;
@@ -50,6 +51,9 @@ public class ManageProjectController {
5051 @ FXML
5152 private ColorPicker textFillColorPicker ;
5253
54+ @ FXML
55+ private Button randomColorButton ;
56+
5357 @ FXML
5458 private CheckBox isWorkCheckBox ;
5559
@@ -59,7 +63,7 @@ public class ManageProjectController {
5963 @ FXML
6064 private Label validateTextAlert ;
6165
62- private BooleanProperty formValidProperty = new SimpleBooleanProperty (false );
66+ private final BooleanProperty formValidProperty = new SimpleBooleanProperty (false );
6367
6468 public ManageProjectController (final Model model ) {
6569 this .model = model ;
@@ -72,7 +76,9 @@ private void initialize() {
7276 sortIndexSpinner .getValueFactory ().setValue (availableProjectAmount );
7377 formValidProperty .bind (Bindings .createBooleanBinding (() -> !nameTextField .getText ().isBlank (),nameTextField .textProperty ()));
7478 validateTextAlert .visibleProperty ().bind (formValidProperty .not ());
75-
79+
80+ randomColorButton .setOnAction (ae -> textFillColorPicker .setValue (ColorHelper .randomColor ()));
81+
7682 Platform .runLater (() ->{
7783 nameTextField .requestFocus ();
7884 nameTextField .end ();
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" encoding =" UTF-8" ?>
22
33<?import javafx .geometry.Insets?>
4+ <?import javafx .scene.control.Button?>
45<?import javafx .scene.control.CheckBox?>
56<?import javafx .scene.control.ColorPicker?>
67<?import javafx .scene.control.Label?>
910<?import javafx .scene.control.TextField?>
1011<?import javafx .scene.layout.ColumnConstraints?>
1112<?import javafx .scene.layout.GridPane?>
13+ <?import javafx .scene.layout.HBox?>
1214<?import javafx .scene.layout.RowConstraints?>
1315<?import javafx .scene.layout.VBox?>
1416
3436 <Label text =" SortIndex:" GridPane.rowIndex=" 6" />
3537 <TextField fx : id =" nameTextField" GridPane.columnIndex=" 1" />
3638 <TextArea fx : id =" descriptionTextArea" prefHeight =" 120.0" prefWidth =" 300.0" GridPane.columnIndex=" 1" GridPane.rowIndex=" 2" />
37- <ColorPicker fx : id =" textFillColorPicker" GridPane.columnIndex=" 1" GridPane.rowIndex=" 4" />
39+ <HBox spacing =" 5.0" GridPane.columnIndex=" 1" GridPane.rowIndex=" 4" >
40+ <children >
41+ <ColorPicker fx : id =" textFillColorPicker" />
42+ <Button fx : id =" randomColorButton" mnemonicParsing =" false" text =" Random" />
43+ </children >
44+ </HBox >
3845 <CheckBox fx : id =" isWorkCheckBox" mnemonicParsing =" false" selected =" true" GridPane.columnIndex=" 1" GridPane.rowIndex=" 5" />
3946 <Spinner fx : id =" sortIndexSpinner" GridPane.columnIndex=" 1" GridPane.rowIndex=" 6" />
4047 <VBox alignment =" CENTER_LEFT" GridPane.rowIndex=" 2" >
You can’t perform that action at this time.
0 commit comments