diff --git a/HMCL/src/main/java/org/jackhuang/hmcl/ui/nbt/NBTTreeView.java b/HMCL/src/main/java/org/jackhuang/hmcl/ui/nbt/NBTTreeView.java index 1448855a9..9db978e08 100644 --- a/HMCL/src/main/java/org/jackhuang/hmcl/ui/nbt/NBTTreeView.java +++ b/HMCL/src/main/java/org/jackhuang/hmcl/ui/nbt/NBTTreeView.java @@ -20,13 +20,14 @@ package org.jackhuang.hmcl.ui.nbt; import com.github.steveice10.opennbt.tag.builtin.CompoundTag; import com.github.steveice10.opennbt.tag.builtin.ListTag; import com.github.steveice10.opennbt.tag.builtin.Tag; -import com.jfoenix.controls.JFXTreeView; import javafx.scene.control.TreeCell; import javafx.scene.control.TreeItem; import javafx.scene.control.TreeView; +import javafx.scene.control.skin.TreeViewSkin; import javafx.scene.image.Image; import javafx.scene.image.ImageView; import javafx.util.Callback; +import org.jackhuang.hmcl.ui.FXUtils; import java.lang.reflect.Array; import java.util.EnumMap; @@ -36,13 +37,22 @@ import static org.jackhuang.hmcl.util.i18n.I18n.i18n; /** * @author Glavo */ -public final class NBTTreeView extends JFXTreeView { +public final class NBTTreeView extends TreeView { public NBTTreeView(NBTTreeView.Item tree) { this.setRoot(tree); this.setCellFactory(cellFactory()); } + @Override + protected javafx.scene.control.Skin createDefaultSkin() { + return new TreeViewSkin(this) { + { + FXUtils.smoothScrolling(getVirtualFlow()); + } + }; + } + private static Callback, TreeCell> cellFactory() { EnumMap icons = new EnumMap<>(NBTTagType.class);