3232import javafx .scene .input .ClipboardContent ;
3333import javafx .scene .layout .BorderPane ;
3434import javafx .scene .layout .GridPane ;
35+ import javafx .scene .shape .Circle ;
3536import javafx .scene .text .Font ;
3637import javafx .scene .text .FontWeight ;
3738import javafx .util .Callback ;
@@ -98,6 +99,10 @@ private void updateReport(final LocalDate newvalue) {
9899
99100 this .gridPane .getChildren ().clear ();
100101 this .gridPane .getRowConstraints ().clear ();
102+ this .gridPane .getColumnConstraints ().get (0 ).setPrefWidth (20 );
103+ this .gridPane .getColumnConstraints ().get (1 ).setPrefWidth (237 );
104+ this .gridPane .getColumnConstraints ().get (2 ).setPrefWidth (154 );
105+ this .gridPane .getColumnConstraints ().get (3 ).setPrefWidth (81 );
101106
102107 int rowIndex = 0 ;
103108 long currentWorkSeconds = 0 ;
@@ -108,7 +113,10 @@ private void updateReport(final LocalDate newvalue) {
108113 for (final Project project : workedProjectsSet ) {
109114 final Label projectName = new Label (project .getName ());
110115 projectName .setFont (labelFontBold );
111- this .gridPane .add (projectName , 0 , rowIndex );
116+ final Circle circle = new Circle (5 , project .getColor ());
117+
118+ this .gridPane .add (circle , 0 , rowIndex );
119+ this .gridPane .add (projectName , 1 , rowIndex );
112120
113121 final List <Work > onlyCurrentProjectWork = currentWorkItems .stream ().filter (w -> w .getProject () == project )
114122 .collect (Collectors .toList ());
@@ -123,12 +131,12 @@ private void updateReport(final LocalDate newvalue) {
123131
124132 final Label workedTimeLabel = new Label (DateFormatter .secondsToHHMMSS (todaysWorkSeconds ));
125133 workedTimeLabel .setFont (labelFontBold );
126- this .gridPane .add (workedTimeLabel , 2 , rowIndex );
134+ this .gridPane .add (workedTimeLabel , 3 , rowIndex );
127135
128136 // text will be set later
129137
130138 final Button bProjectReport = createProjectReport ();
131- this .gridPane .add (bProjectReport , 1 , rowIndex );
139+ this .gridPane .add (bProjectReport , 2 , rowIndex );
132140
133141 rowIndex ++;
134142
@@ -143,17 +151,17 @@ private void updateReport(final LocalDate newvalue) {
143151 final Label commentLabel = new Label (currentWorkNote );
144152 commentLabel .setFont (labelFontNormal );
145153 commentLabel .setWrapText (true );
146- this .gridPane .add (commentLabel , 0 , rowIndex );
154+ this .gridPane .add (commentLabel , 1 , rowIndex );
147155
148156 final Label fromTillLabel = new Label (DateFormatter .toTimeString (work .getStartTime ()) + " - "
149157 + DateFormatter .toTimeString (work .getEndTime ()));
150158 fromTillLabel .setFont (labelFontNormal );
151159 fromTillLabel .setWrapText (true );
152- this .gridPane .add (fromTillLabel , 1 , rowIndex );
160+ this .gridPane .add (fromTillLabel , 2 , rowIndex );
153161
154162 final Label workedHoursLabel = new Label (workedHours );
155163 workedHoursLabel .setFont (labelFontNormal );
156- this .gridPane .add (workedHoursLabel , 2 , rowIndex );
164+ this .gridPane .add (workedHoursLabel , 3 , rowIndex );
157165
158166 rowIndex ++;
159167 }
0 commit comments