DEBUG/FIX::fixed bug where total amount of vegetarian meals wouldn't update

fixed the bug where totalVeganMeals wouldn't update on clicking the activities button if you were already on the activities screen

ADD::added id to 'add activity' button on dashboard

for adding a color change when clicking it, still need to implement it completely
This commit is contained in:
Sem van der Hoeven
2019-03-20 13:15:12 +01:00
parent 8345b6c06f
commit 93aaf19f13
3 changed files with 13 additions and 3 deletions

View File

@@ -50,6 +50,7 @@ public class DashBoardController {
public Button userButton;
public Line pathLine;
public AnchorPane menuBar;
public Button addNewActivityButton;
FadeTransition fadeTrans; //transition for switching between the different panels
@@ -67,6 +68,7 @@ public class DashBoardController {
userButton.setSkin(new MyButtonSkin(userButton));
}
/**
@@ -101,9 +103,12 @@ public class DashBoardController {
* @param event the event (clicking the button)
*/
public void displayActivities(ActionEvent event) {
addFadeTransition(activitiesPane);
totalVeganMealCounter.setText("" + userService.currentUser.getVeganMeal());
int net = userService.currentUser.getVeganMeal() + count;
totalVeganMealCounter.setText("" + net);
System.out.println("display activities");
dashboardPane.setVisible(false);
userPane.setVisible(false);
@@ -141,8 +146,9 @@ public class DashBoardController {
System.out.println("Vegetarian meal is added");
}
//sets the slide in transition for startup
public void addSlideTransition(Node node, Line path1) {
PathTransition pathTrans = new PathTransition(Duration.millis(1500), path1, node);
PathTransition pathTrans = new PathTransition(Duration.millis(1100), path1, node);
pathTrans.play();
}

View File

@@ -196,7 +196,7 @@
<Font size="30.0" />
</font>
</Label>
<Button contentDisplay="RIGHT" layoutX="496.0" layoutY="26.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="74.0" prefWidth="200.0" style="-fx-border-radius: 20px; -fx-padding: 0px 0px 0px 0px; -fx-background-color: transparent;" text="Add a new activity" textFill="#29721a">
<Button fx:id="addNewActivityButton" contentDisplay="RIGHT" layoutX="496.0" layoutY="26.0" mnemonicParsing="false" onAction="#displayActivities" prefHeight="74.0" prefWidth="200.0" style="-fx-border-radius: 20px; -fx-padding: 0px 0px 0px 0px; -fx-background-color: transparent;" text="Add a new activity" textFill="#29721a">
<font>
<Font name="Corbel Bold" size="14.0" />
</font>

View File

@@ -39,3 +39,7 @@
-fx-background-color: #b7e2c2;
}
#addNewActivityButton:pressed {
-fx-background-color: #e8e8e8;
}