@@ -119,9 +119,9 @@ public class ViewController {
119119 private Canvas canvas ;
120120
121121 private final Logger LOG = LoggerFactory .getLogger (this .getClass ());
122- final private String RGBA = "rgba(" ;
123- final private String ARIAL = "Arial" ;
124- final private String TIME_ZERO = "00:00:00" ;
122+ private static final String RGBA = "rgba(" ;
123+ private static final String ARIAL = "Arial" ;
124+ private static final String TIME_ZERO = "00:00:00" ;
125125
126126 boolean pressed = false ;
127127 double startX = -1 ;
@@ -173,7 +173,7 @@ public void changeProject(final Project newProject, final long minusSeconds) {
173173 private void initialize () throws IOException {
174174
175175 bigTimeLabel .setText (TIME_ZERO );
176- bigTimeLabel .setFont (new Font ("Arial" , 60 ));
176+ bigTimeLabel .setFont (new Font (ARIAL , 60 ));
177177 allTimeLabel .setText (TIME_ZERO );
178178 todayAllSeconds .setText (TIME_ZERO );
179179
@@ -187,17 +187,7 @@ private void initialize() throws IOException {
187187
188188 // reposition window if projects are hidden (as anchor is top left)
189189 mouseHoveringProperty .addListener ((a , b , c ) -> {
190- // TODO fix the not so nice jumping..
191- projectsVBox .setManaged (c );
192- final double beforeWidth = mainStage .getWidth ();
193- mainStage .sizeToScene ();
194- final double afterWidth = mainStage .getWidth ();
195- projectsVBox .setVisible (c );
196- final double offset = afterWidth - beforeWidth ;
197- if (!model .displayProjectsRight .get ()) {
198- // we only need to move the stage if the node on the left is hidden
199- mainStage .setX (mainStage .getX () - offset );
200- }
190+ setProjectWindowVisibleByMouseHover (c );
201191 });
202192
203193 minimizeButton .setOnAction ((ae ) -> {
@@ -444,7 +434,7 @@ private void initialize() throws IOException {
444434 return Duration .between (work .getStartTime (), work .getEndTime ()).getSeconds ();
445435 }).sum ();
446436 label .setText (DateFormatter .secondsToHHMMSS (seconds ));
447- label .setFont (new Font ("Arial" , 12 ));
437+ label .setFont (new Font (ARIAL , 12 ));
448438 }
449439
450440 updateProjectColorTimeline ();
@@ -453,6 +443,20 @@ private void initialize() throws IOException {
453443
454444 }
455445
446+ private void setProjectWindowVisibleByMouseHover (final Boolean c ) {
447+ // TODO fix the not so nice jumping..
448+ projectsVBox .setManaged (c );
449+ final double beforeWidth = mainStage .getWidth ();
450+ mainStage .sizeToScene ();
451+ final double afterWidth = mainStage .getWidth ();
452+ projectsVBox .setVisible (c );
453+ final double offset = afterWidth - beforeWidth ;
454+ if (!model .displayProjectsRight .get ()) {
455+ // we only need to move the stage if the node on the left is hidden
456+ mainStage .setX (mainStage .getX () - offset );
457+ }
458+ }
459+
456460 private void loadSubStages () {
457461 try {
458462 // Report stage
0 commit comments