Skip to content

Commit

Permalink
close #105: fixed UI changes not called from the FX thread
Browse files Browse the repository at this point in the history
  • Loading branch information
torakiki committed Oct 28, 2015
1 parent 1913177 commit 17773f4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.pdfsam.news.LatestNewsEvent;
import org.sejda.eventstudio.ReferenceStrength;

import javafx.application.Platform;
import javafx.scene.layout.HBox;

/**
Expand All @@ -44,8 +45,10 @@ class BannerButtons extends HBox {
getChildren().addAll(dashboardButton, logButton, newsButton, menuButton);
eventStudio().add(LatestNewsEvent.class, (e) -> {
if (!e.latestNews.isEmpty()) {
newsButton.setDisable(false);
newsButton.setUpToDate(e.isUpToDate);
Platform.runLater(() -> {
newsButton.setDisable(false);
newsButton.setUpToDate(e.isUpToDate);
});
}
} , Integer.MAX_VALUE, ReferenceStrength.STRONG);
}
Expand Down

0 comments on commit 17773f4

Please sign in to comment.