diff --git a/src/de/deadlocker8/budgetmaster/ui/Controller.java b/src/de/deadlocker8/budgetmaster/ui/Controller.java index 72dd89028d9fb763269ae8ada420ba7ab6cbf6be..c6b59b2e80a6b1f7af5632cb08b3b642b67abef1 100644 --- a/src/de/deadlocker8/budgetmaster/ui/Controller.java +++ b/src/de/deadlocker8/budgetmaster/ui/Controller.java @@ -43,6 +43,7 @@ public class Controller implements Refreshable @FXML private Label labelMonth; @FXML private Button buttonLeft; @FXML private Button buttonRight; + @FXML private Button buttonToday; @FXML private TabPane tabPane; @FXML private Tab tabHome; @FXML private Tab tabPayments; @@ -124,6 +125,9 @@ public class Controller implements Refreshable FontIcon iconNext = new FontIcon(FontIconType.CHEVRON_RIGHT); iconNext.setSize(20); buttonRight.setGraphic(iconNext); + FontIcon iconToday = new FontIcon(FontIconType.CALENDAR_ALT); + iconToday.setSize(20); + buttonToday.setGraphic(iconToday); // apply theme anchorPaneMain.setStyle("-fx-background-color: #DDDDDD"); @@ -131,6 +135,7 @@ public class Controller implements Refreshable labelNotification.setStyle("-fx-text-fill: #FFFFFF; -fx-font-size: 16; -fx-font-weight: bold; -fx-background-color: transparent;"); buttonLeft.setStyle("-fx-background-color: transparent;"); buttonRight.setStyle("-fx-background-color: transparent;"); + buttonToday.setStyle("-fx-background-color: transparent;"); if(settings == null) { @@ -206,6 +211,14 @@ public class Controller implements Refreshable refresh(); } + + public void today() + { + currentDate = DateTime.now(); + labelMonth.setText(currentDate.toString("MMMM yyyy")); + + refresh(); + } public DateTime getCurrentDate() { diff --git a/src/de/deadlocker8/budgetmaster/ui/GUI.fxml b/src/de/deadlocker8/budgetmaster/ui/GUI.fxml index 4e15a8e7546acff8b18081fc92283329ca789902..122b897e50a412a24f72688ec0a6db4237fbdfa6 100644 --- a/src/de/deadlocker8/budgetmaster/ui/GUI.fxml +++ b/src/de/deadlocker8/budgetmaster/ui/GUI.fxml @@ -1,5 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> +<?import javafx.geometry.Insets?> <?import javafx.scene.control.Button?> <?import javafx.scene.control.Label?> <?import javafx.scene.control.Tab?> @@ -23,6 +24,11 @@ </font> </Label> <Button fx:id="buttonRight" mnemonicParsing="false" onAction="#nextMonth" /> + <Button fx:id="buttonToday" alignment="CENTER" mnemonicParsing="false" onAction="#today"> + <HBox.margin> + <Insets /> + </HBox.margin> + </Button> </children> </HBox> <StackPane alignment="BOTTOM_CENTER" VBox.vgrow="ALWAYS">