禁用 LogWindow 的平滑滚动效果 (#5046)
This commit is contained in:
@@ -39,8 +39,11 @@ public class JFXListViewSkin<T> extends ListViewSkin<T> {
|
|||||||
flow = (VirtualFlow<ListCell<T>>) getChildren().get(0);
|
flow = (VirtualFlow<ListCell<T>>) getChildren().get(0);
|
||||||
JFXDepthManager.setDepth(flow, listView.depthProperty().get());
|
JFXDepthManager.setDepth(flow, listView.depthProperty().get());
|
||||||
listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(flow, newVal));
|
listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(flow, newVal));
|
||||||
|
|
||||||
|
if (!Boolean.TRUE.equals(listView.getProperties().get("no-smooth-scrolling"))) {
|
||||||
FXUtils.smoothScrolling(flow);
|
FXUtils.smoothScrolling(flow);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
|
protected double computePrefWidth(double height, double topInset, double rightInset, double bottomInset, double leftInset) {
|
||||||
|
|||||||
@@ -204,6 +204,7 @@ public final class LogWindow extends Stage {
|
|||||||
LogWindowImpl() {
|
LogWindowImpl() {
|
||||||
getStyleClass().add("log-window");
|
getStyleClass().add("log-window");
|
||||||
|
|
||||||
|
listView.getProperties().put("no-smooth-scrolling", true);
|
||||||
listView.setItems(FXCollections.observableList(new CircularArrayList<>(logs.size())));
|
listView.setItems(FXCollections.observableList(new CircularArrayList<>(logs.size())));
|
||||||
|
|
||||||
for (int i = 0; i < LEVELS.length; i++) {
|
for (int i = 0; i < LEVELS.length; i++) {
|
||||||
|
|||||||
Reference in New Issue
Block a user