mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-28 11:25:37 +00:00
Rework switches
This commit is contained in:
@@ -45,9 +45,12 @@ public class LoadingOverlayComp extends RegionBuilder<StackPane> {
|
||||
}
|
||||
loadingOverlay.getStyleClass().add("loading-comp");
|
||||
|
||||
this.loading.subscribe((v) -> {
|
||||
loadingOverlay.setVisible(this.loading.getValue());
|
||||
loadingOverlay.setManaged(this.loading.getValue());
|
||||
|
||||
this.loading.addListener((observable, oldValue, newValue) -> {
|
||||
// Reduce flickering for consecutive loads
|
||||
if (!v) {
|
||||
if (!newValue) {
|
||||
GlobalTimer.delay(() -> {
|
||||
if (!LoadingOverlayComp.this.loading.getValue()) {
|
||||
Platform.runLater(() -> {
|
||||
|
||||
Reference in New Issue
Block a user