Attempt to make scrolling smoother

This commit is contained in:
crschnick
2025-11-05 00:09:58 +00:00
parent 5e40d2c090
commit 57c0336e6e
@@ -8,6 +8,7 @@ import io.xpipe.app.platform.BindingsHelper;
import io.xpipe.app.platform.LabelGraphic;
import io.xpipe.app.storage.DataStoreColor;
import javafx.application.Platform;
import javafx.beans.binding.Bindings;
import javafx.beans.property.SimpleBooleanProperty;
import javafx.beans.value.ObservableBooleanValue;
@@ -88,11 +89,21 @@ public abstract class StoreSectionBaseComp extends Comp<CompStructure<VBox>> {
var children = new ArrayList<>(hbox.getChildren());
hbox.getChildren().clear();
root.visibleProperty().subscribe((newValue) -> {
if (newValue) {
hbox.getChildren().addAll(children);
} else {
hbox.getChildren().removeAll(children);
}
Platform.runLater(() -> {
if (newValue) {
if (!root.isVisible()) {
return;
}
hbox.getChildren().addAll(children);
} else {
if (root.isVisible()) {
return;
}
hbox.getChildren().removeAll(children);
}
});
});
}