Skip to content
Snippets Groups Projects
Commit ce09d318 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #62 - add button "today" on date toggler

parent 9ac73baf
Branches
Tags
No related merge requests found
......@@ -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)
{
......@@ -207,6 +212,14 @@ public class Controller implements Refreshable
refresh();
}
public void today()
{
currentDate = DateTime.now();
labelMonth.setText(currentDate.toString("MMMM yyyy"));
refresh();
}
public DateTime getCurrentDate()
{
return currentDate;
......
<?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">
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment