From 4abda0fe1771c423d7104bdb3b3e3485799120ba Mon Sep 17 00:00:00 2001 From: ix0rai Date: Fri, 18 Oct 2024 21:20:35 -0500 Subject: [PATCH] fix folder icons not being present in obfuscated classes docker - fixes #221 --- enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java | 4 ++++ .../org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java | 4 ---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java index 58791c22b..8cd3e755a 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/Gui.java @@ -55,6 +55,7 @@ import javax.swing.JScrollBar; import javax.swing.JSplitPane; import javax.swing.SwingUtilities; +import javax.swing.UIManager; import javax.swing.WindowConstants; import java.awt.BorderLayout; import java.awt.Container; @@ -162,6 +163,9 @@ private void setupDockers() { } private void setupUi() { + // fix folder icons being automatically hidden: https://github.com/JFormDesigner/FlatLaf/pull/609 + UIManager.put("Tree.showDefaultIcons", true); + this.setupDockers(); this.jarFileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); diff --git a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java index aa514498b..3e2148fff 100644 --- a/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java +++ b/enigma-swing/src/main/java/org/quiltmc/enigma/gui/element/ClassTreeCellRenderer.java @@ -15,7 +15,6 @@ import javax.swing.Icon; import javax.swing.JLabel; import javax.swing.JTree; -import javax.swing.UIManager; import javax.swing.tree.DefaultTreeCellRenderer; import java.awt.Component; import java.util.function.Function; @@ -27,9 +26,6 @@ public class ClassTreeCellRenderer extends DefaultTreeCellRenderer { public ClassTreeCellRenderer(Gui gui, ClassSelector selector) { this.controller = gui.getController(); this.selector = selector; - - // fix folder icons being automatically hidden: https://github.com/JFormDesigner/FlatLaf/pull/609 - UIManager.put("Tree.showDefaultIcons", true); } @Override