From a19be490f712094f947e3870f97b99e6175257a4 Mon Sep 17 00:00:00 2001 From: Jannis Weis <31143295+weisJ@users.noreply.github.com> Date: Sun, 17 Apr 2022 23:48:17 +0200 Subject: [PATCH] Update darklaf to version 3.0.0 This resolves an outstanding issue allowing us to remove the temporary fix for it. Also, the "frame.svg" icon is now loaded using the official API and no longer relies on the exact location of the resource. --- pom.xml | 2 +- .../the/bytecode/club/bytecodeviewer/BytecodeViewer.java | 3 --- .../bytecodeviewer/gui/components/VisibleComponent.java | 5 ++--- .../club/bytecodeviewer/plugin/PluginWriter.java | 9 +-------- 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/pom.xml b/pom.xml index de7b3cbe..a4cbc8b0 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ 2.11.0 3.12.0 1.9 - 2.7.3 + 3.0.0 0.3.4 5.2.1.Final v49 diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java index afbebc35..4210f384 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/BytecodeViewer.java @@ -93,9 +93,6 @@ import static the.bytecode.club.bytecodeviewer.Constants.tempDirectory; * + Anything using blindlySearchForClassNode() should instead search through the resource container search function * + BCV's classLoader should be destroyed each time a resource is added or removed * - * TODO DarkLAF Specific Bugs: - * + JMenuBar can only be displayed on a JFrame, a work around is needed for this (Partially solved) - * * TODO IN-PROGRESS: * + Resource Exporter/Save/Decompile As Zip needs to be rewritten * + Finish dragging code diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java index e887f8c2..8b2b017f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/gui/components/VisibleComponent.java @@ -1,10 +1,9 @@ package the.bytecode.club.bytecodeviewer.gui.components; -import com.github.weisj.darklaf.icons.ThemedSVGIcon; +import com.github.weisj.darklaf.iconset.AllIcons; import javax.swing.BorderFactory; import javax.swing.JInternalFrame; import the.bytecode.club.bytecodeviewer.Configuration; -import the.bytecode.club.bytecodeviewer.gui.resourceviewer.Workspace; import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme; import the.bytecode.club.bytecodeviewer.resources.IconResources; @@ -55,7 +54,7 @@ public abstract class VisibleComponent extends JInternalFrame { try { if(Configuration.showDarkLAFComponentIcons) - setFrameIcon(new ThemedSVGIcon(Workspace.class.getResource("/com/github/weisj/darklaf/icons/frame/frame.svg").toURI(), 16, 16)); + setFrameIcon(AllIcons.Window.Frame.get(16, 16)); else setFrameIcon(IconResources.jarIcon); } catch (Exception e) { diff --git a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java index 294382b7..558f546f 100644 --- a/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java +++ b/src/main/java/the/bytecode/club/bytecodeviewer/plugin/PluginWriter.java @@ -133,14 +133,7 @@ public class PluginWriter extends JFrame p.add(p2, BorderLayout.NORTH); p.add(component, BorderLayout.CENTER); - JMenuBar menuBar = getJMenuBar(); - // As the Darklaf windows decorations steal the menu bar from the frame - // it sets the preferred size to (0,0). Because we want to steal the menu bar ourselves. - // we have to revert this change. - // Remove when https://github.com/weisJ/darklaf/issues/258 is fixed and available in a - // release. - menuBar.setPreferredSize(null); - p2.add(menuBar, BorderLayout.CENTER); + p2.add(getJMenuBar(), BorderLayout.CENTER); ComponentViewer.addComponentAsTab(pluginName, p); }