From 0adf4fcf322f820f1d6a7475df3f9dc953f59993 Mon Sep 17 00:00:00 2001 From: Glavo Date: Sun, 1 Feb 2026 15:11:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=A8=20NBTTreeView=20=E4=B8=8A=E5=90=AF?= =?UTF-8?q?=E7=94=A8=E5=B9=B3=E6=BB=91=E6=BB=9A=E5=8A=A8=20(#5364)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../org/jackhuang/hmcl/ui/nbt/NBTTreeView.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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);