mirror of
https://github.com/xpipe-io/xpipe.git
synced 2024-10-02 18:17:27 +13:00
Fix platform thread issue
This commit is contained in:
parent
305f8d69e8
commit
5d5c3ea140
1 changed files with 7 additions and 5 deletions
|
@ -7,6 +7,7 @@ import atlantafx.base.theme.Tweaks;
|
|||
import io.xpipe.app.comp.base.LazyTextFieldComp;
|
||||
import io.xpipe.app.core.AppResources;
|
||||
import io.xpipe.app.fxcomps.impl.PrettyImageComp;
|
||||
import io.xpipe.app.fxcomps.util.PlatformThread;
|
||||
import io.xpipe.app.fxcomps.util.SimpleChangeListener;
|
||||
import io.xpipe.app.util.Containers;
|
||||
import io.xpipe.app.util.HumanReadableFormat;
|
||||
|
@ -234,11 +235,12 @@ final class FileListComp extends AnchorPane {
|
|||
});
|
||||
|
||||
fileList.getShown().addListener((observable, oldValue, newValue) -> {
|
||||
table.getItems().setAll(newValue);
|
||||
|
||||
if (newValue.size() > 0) {
|
||||
table.scrollTo(0);
|
||||
}
|
||||
PlatformThread.runLaterIfNeededBlocking(() -> {
|
||||
table.getItems().setAll(newValue);
|
||||
if (newValue.size() > 0) {
|
||||
table.scrollTo(0);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return table;
|
||||
|
|
Loading…
Reference in a new issue