mirror of
https://github.com/xpipe-io/xpipe.git
synced 2026-09-25 01:45:37 +00:00
Attempt to make scrolling smoother
This commit is contained in:
@@ -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);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user