2121import javafx .event .ActionEvent ;
2222import javafx .event .EventHandler ;
2323import javafx .fxml .FXML ;
24+ import javafx .geometry .Insets ;
25+ import javafx .geometry .Pos ;
2426import javafx .scene .Node ;
2527import javafx .scene .canvas .Canvas ;
2628import javafx .scene .control .Button ;
3234import javafx .scene .input .ClipboardContent ;
3335import javafx .scene .layout .BorderPane ;
3436import javafx .scene .layout .GridPane ;
37+ import javafx .scene .layout .HBox ;
3538import javafx .scene .shape .Circle ;
3639import javafx .scene .text .Font ;
3740import javafx .scene .text .FontWeight ;
@@ -99,10 +102,7 @@ private void updateReport(final LocalDate newvalue) {
99102
100103 this .gridPane .getChildren ().clear ();
101104 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 );
105+ this .gridPane .getColumnConstraints ().get (0 ).setPrefWidth (247 );
106106
107107 int rowIndex = 0 ;
108108 long currentWorkSeconds = 0 ;
@@ -115,8 +115,15 @@ private void updateReport(final LocalDate newvalue) {
115115 projectName .setFont (labelFontBold );
116116 final Circle circle = new Circle (5 , project .getColor ());
117117
118- this .gridPane .add (circle , 0 , rowIndex );
119- this .gridPane .add (projectName , 1 , rowIndex );
118+ final HBox nameHBox = new HBox ();
119+ nameHBox .setAlignment (Pos .CENTER_LEFT );
120+ nameHBox .setPadding (new Insets (0 , 0 , 0 , 5 ));
121+ nameHBox .setSpacing (5 );
122+
123+ nameHBox .getChildren ().add (circle );
124+ nameHBox .getChildren ().add (projectName );
125+
126+ this .gridPane .add (nameHBox , 0 , rowIndex );
120127
121128 final List <Work > onlyCurrentProjectWork = currentWorkItems .stream ().filter (w -> w .getProject () == project )
122129 .collect (Collectors .toList ());
@@ -131,12 +138,12 @@ private void updateReport(final LocalDate newvalue) {
131138
132139 final Label workedTimeLabel = new Label (DateFormatter .secondsToHHMMSS (todaysWorkSeconds ));
133140 workedTimeLabel .setFont (labelFontBold );
134- this .gridPane .add (workedTimeLabel , 3 , rowIndex );
141+ this .gridPane .add (workedTimeLabel , 2 , rowIndex );
135142
136143 // text will be set later
137144
138145 final Button bProjectReport = createProjectReport ();
139- this .gridPane .add (bProjectReport , 2 , rowIndex );
146+ this .gridPane .add (bProjectReport , 1 , rowIndex );
140147
141148 rowIndex ++;
142149
@@ -151,17 +158,17 @@ private void updateReport(final LocalDate newvalue) {
151158 final Label commentLabel = new Label (currentWorkNote );
152159 commentLabel .setFont (labelFontNormal );
153160 commentLabel .setWrapText (true );
154- this .gridPane .add (commentLabel , 1 , rowIndex );
161+ this .gridPane .add (commentLabel , 0 , rowIndex );
155162
156163 final Label fromTillLabel = new Label (DateFormatter .toTimeString (work .getStartTime ()) + " - "
157164 + DateFormatter .toTimeString (work .getEndTime ()));
158165 fromTillLabel .setFont (labelFontNormal );
159166 fromTillLabel .setWrapText (true );
160- this .gridPane .add (fromTillLabel , 2 , rowIndex );
167+ this .gridPane .add (fromTillLabel , 1 , rowIndex );
161168
162169 final Label workedHoursLabel = new Label (workedHours );
163170 workedHoursLabel .setFont (labelFontNormal );
164- this .gridPane .add (workedHoursLabel , 3 , rowIndex );
171+ this .gridPane .add (workedHoursLabel , 2 , rowIndex );
165172
166173 rowIndex ++;
167174 }
0 commit comments