Skip to content

Commit eac12ef

Browse files
authored
[release/3.9] 禁用 LogWindow 的平滑滚动效果 (#5227)
#5046
1 parent d3d46f6 commit eac12ef

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

HMCL/src/main/java/com/jfoenix/skins/JFXListViewSkin.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,10 @@ public JFXListViewSkin(final JFXListView<T> listView) {
3939
flow = (VirtualFlow<ListCell<T>>) getChildren().get(0);
4040
JFXDepthManager.setDepth(flow, listView.depthProperty().get());
4141
listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(flow, newVal));
42-
FXUtils.smoothScrolling(flow);
42+
43+
if (!Boolean.TRUE.equals(listView.getProperties().get("no-smooth-scrolling"))) {
44+
FXUtils.smoothScrolling(flow);
45+
}
4346
}
4447

4548
@Override

HMCL/src/main/java/org/jackhuang/hmcl/ui/LogWindow.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,7 @@ private final class LogWindowImpl extends Control {
204204
LogWindowImpl() {
205205
getStyleClass().add("log-window");
206206

207+
listView.getProperties().put("no-smooth-scrolling", true);
207208
listView.setItems(FXCollections.observableList(new CircularArrayList<>(logs.size())));
208209

209210
for (int i = 0; i < LEVELS.length; i++) {

0 commit comments

Comments
 (0)