Signed-off-by: Armin Schrenk <armin.schrenk@skymatic.de>
This commit is contained in:
Armin Schrenk
2025-12-05 10:50:48 +01:00
parent 5e229395f1
commit 8e9a001fde
2 changed files with 29 additions and 24 deletions

View File

@@ -67,36 +67,41 @@ public class NotificationController implements FxController {
@FXML
public void handleButtonAction() {
var ev = selectedEvent.get();
switch (ev) {
default -> {
} //normally nothing
}
//executorService.submit(callback.action());
int i = selectionIndex.get();
notificationsProp.remove(i); //remove processed event
if (notificationsProp.isEmpty()) {
close(); //no more events
} else if (notificationsProp.size() == i) {
i = i - 1;
selectionIndex.set(i); //triggers event update
} else {
selectedEvent.set(notificationsProp.get(i));
try {
var ev = selectedEvent.get();
switch (ev) {
//TODO: executorService.submit(callback.action());
default -> {
} //normally nothing
}
} finally {
//remove processed event
int i = selectionIndex.get();
notificationsProp.remove(i);
if (notificationsProp.isEmpty()) {
close(); //no more events
} else if (notificationsProp.size() == i) {
i = i - 1;
selectionIndex.set(i); //triggers event update
} else {
selectedEvent.set(notificationsProp.get(i));
}
}
}
@FXML void previousNotification() {
@FXML
public void previousNotification() {
int i = selectionIndex.get();
if( i != 0) {
selectionIndex.set(i-1);
if (i != 0) {
selectionIndex.set(i - 1);
}
}
@FXML void nextNotification() {
@FXML
public void nextNotification() {
int i = selectionIndex.get();
if(i != notificationsProp.size() - 1){
selectionIndex.set(i+1);
if (i != notificationsProp.size() - 1) {
selectionIndex.set(i + 1);
}
}

View File

@@ -16,7 +16,7 @@
prefHeight="200.0" prefWidth="300.0" maxHeight="300.0" maxWidth="400.0"
styleClass="notification-window">
<padding>
<Insets top="18" right="24" bottom="22" left="24"/>
<Insets top="12" right="12" bottom="12" left="12"/>
</padding>
<top>
<HBox spacing="12" styleClass="dialog-header" alignment="CENTER_LEFT">
@@ -34,7 +34,7 @@
</top>
<center>
<VBox spacing="10">
<VBox spacing="12">
<!--Label text="${controller.message}" styleClass="label-large" wrapText="true"/-->
<Label text="${controller.description}" styleClass="label" wrapText="true"/>
</VBox>