禁用 LogWindow 的平滑滚动效果 (#5046)

This commit is contained in:
Glavo
2025-12-23 20:11:46 +08:00
committed by GitHub
parent a77ef95ce4
commit cc87f6cdd1
2 changed files with 5 additions and 1 deletions

View File

@@ -39,7 +39,10 @@ public class JFXListViewSkin<T> extends ListViewSkin<T> {
flow = (VirtualFlow<ListCell<T>>) getChildren().get(0);
JFXDepthManager.setDepth(flow, listView.depthProperty().get());
listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(flow, newVal));
FXUtils.smoothScrolling(flow);
if (!Boolean.TRUE.equals(listView.getProperties().get("no-smooth-scrolling"))) {
FXUtils.smoothScrolling(flow);
}
}
@Override

View File

@@ -204,6 +204,7 @@ public final class LogWindow extends Stage {
LogWindowImpl() {
getStyleClass().add("log-window");
listView.getProperties().put("no-smooth-scrolling", true);
listView.setItems(FXCollections.observableList(new CircularArrayList<>(logs.size())));
for (int i = 0; i < LEVELS.length; i++) {