File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
HMCL/src/main/java/org/jackhuang/hmcl/ui/nbt Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change 2020import com .github .steveice10 .opennbt .tag .builtin .CompoundTag ;
2121import com .github .steveice10 .opennbt .tag .builtin .ListTag ;
2222import com .github .steveice10 .opennbt .tag .builtin .Tag ;
23- import com .jfoenix .controls .JFXTreeView ;
2423import javafx .scene .control .TreeCell ;
2524import javafx .scene .control .TreeItem ;
2625import javafx .scene .control .TreeView ;
26+ import javafx .scene .control .skin .TreeViewSkin ;
2727import javafx .scene .image .Image ;
2828import javafx .scene .image .ImageView ;
2929import javafx .util .Callback ;
30+ import org .jackhuang .hmcl .ui .FXUtils ;
3031
3132import java .lang .reflect .Array ;
3233import java .util .EnumMap ;
3637/**
3738 * @author Glavo
3839 */
39- public final class NBTTreeView extends JFXTreeView <Tag > {
40+ public final class NBTTreeView extends TreeView <Tag > {
4041
4142 public NBTTreeView (NBTTreeView .Item tree ) {
4243 this .setRoot (tree );
4344 this .setCellFactory (cellFactory ());
4445 }
4546
47+ @ Override
48+ protected javafx .scene .control .Skin <?> createDefaultSkin () {
49+ return new TreeViewSkin <Tag >(this ) {
50+ {
51+ FXUtils .smoothScrolling (getVirtualFlow ());
52+ }
53+ };
54+ }
55+
4656 private static Callback <TreeView <Tag >, TreeCell <Tag >> cellFactory () {
4757 EnumMap <NBTTagType , Image > icons = new EnumMap <>(NBTTagType .class );
4858
You can’t perform that action at this time.
0 commit comments