commit
7d6a945b25
4 changed files with 30 additions and 11 deletions
|
@ -84,7 +84,7 @@ import static the.bytecode.club.bytecodeviewer.Constants.*;
|
||||||
*
|
*
|
||||||
* TODO DarkLAF Specific Bugs:
|
* TODO DarkLAF Specific Bugs:
|
||||||
* + Resource List creates swing lag with large project
|
* + Resource List creates swing lag with large project
|
||||||
* + JMenuBar can only be displayed on a JFrame, a work around is needed for this
|
* + JMenuBar can only be displayed on a JFrame, a work around is needed for this (Partially solved)
|
||||||
*
|
*
|
||||||
* TODO IN-PROGRESS:
|
* TODO IN-PROGRESS:
|
||||||
* + Resource Exporter/Save/Decompile As Zip needs to be rewritten
|
* + Resource Exporter/Save/Decompile As Zip needs to be rewritten
|
||||||
|
|
|
@ -3,8 +3,10 @@ package the.bytecode.club.bytecodeviewer.gui.components;
|
||||||
import com.github.weisj.darklaf.icons.ThemedSVGIcon;
|
import com.github.weisj.darklaf.icons.ThemedSVGIcon;
|
||||||
import the.bytecode.club.bytecodeviewer.Configuration;
|
import the.bytecode.club.bytecodeviewer.Configuration;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.resourceviewer.Workspace;
|
import the.bytecode.club.bytecodeviewer.gui.resourceviewer.Workspace;
|
||||||
|
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
|
||||||
import the.bytecode.club.bytecodeviewer.resources.IconResources;
|
import the.bytecode.club.bytecodeviewer.resources.IconResources;
|
||||||
|
|
||||||
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.JInternalFrame;
|
import javax.swing.JInternalFrame;
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
|
@ -41,6 +43,15 @@ public abstract class VisibleComponent extends JInternalFrame
|
||||||
this.setDefaultIcon();
|
this.setDefaultIcon();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateUI() {
|
||||||
|
if (Configuration.lafTheme != LAFTheme.SYSTEM)
|
||||||
|
setBorder(BorderFactory.createEmptyBorder());
|
||||||
|
else
|
||||||
|
setBorder(null);
|
||||||
|
super.updateUI();
|
||||||
|
}
|
||||||
|
|
||||||
public void setDefaultIcon()
|
public void setDefaultIcon()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -6,7 +6,6 @@ import org.apache.commons.compress.utils.FileNameUtils;
|
||||||
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
|
||||||
import the.bytecode.club.bytecodeviewer.Configuration;
|
import the.bytecode.club.bytecodeviewer.Configuration;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer;
|
import the.bytecode.club.bytecodeviewer.gui.resourceviewer.viewer.ComponentViewer;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
|
|
||||||
import the.bytecode.club.bytecodeviewer.resources.IconResources;
|
import the.bytecode.club.bytecodeviewer.resources.IconResources;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.components.FileChooser;
|
import the.bytecode.club.bytecodeviewer.gui.components.FileChooser;
|
||||||
import the.bytecode.club.bytecodeviewer.gui.components.SearchableRSyntaxTextArea;
|
import the.bytecode.club.bytecodeviewer.gui.components.SearchableRSyntaxTextArea;
|
||||||
|
@ -18,6 +17,7 @@ import the.bytecode.club.bytecodeviewer.util.MiscUtils;
|
||||||
import the.bytecode.club.bytecodeviewer.util.SyntaxLanguage;
|
import the.bytecode.club.bytecodeviewer.util.SyntaxLanguage;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
|
import javax.swing.border.LineBorder;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -123,15 +123,17 @@ public class PluginWriter extends JFrame
|
||||||
|
|
||||||
JPanel p = new JPanel(new BorderLayout());
|
JPanel p = new JPanel(new BorderLayout());
|
||||||
JPanel p2 = new JPanel(new BorderLayout());
|
JPanel p2 = new JPanel(new BorderLayout());
|
||||||
|
|
||||||
p.add(p2, BorderLayout.NORTH);
|
p.add(p2, BorderLayout.NORTH);
|
||||||
p.add(component, BorderLayout.CENTER);
|
p.add(component, BorderLayout.CENTER);
|
||||||
|
|
||||||
if(Configuration.lafTheme == LAFTheme.SYSTEM)
|
JMenuBar menuBar = getJMenuBar();
|
||||||
p2.add(getJMenuBar(), BorderLayout.CENTER);
|
// As the Darklaf windows decorations steal the menu bar from the frame
|
||||||
else //TODO DarkLAF wont display the jMenuBar due to how it handles them, instead display the menu
|
// it sets the preferred size to (0,0). Because we want to steal the menu bar ourselves.
|
||||||
//TODO make the menu interactable and display the menu manually
|
// we have to revert this change.
|
||||||
p2.add(getJMenuBar().getMenu(0), BorderLayout.CENTER);
|
// Remove when https://github.com/weisJ/darklaf/issues/258 is fixed and available in a
|
||||||
|
// release.
|
||||||
|
menuBar.setPreferredSize(null);
|
||||||
|
p2.add(menuBar, BorderLayout.CENTER);
|
||||||
|
|
||||||
ComponentViewer.addComponentAsTab(pluginName, p);
|
ComponentViewer.addComponentAsTab(pluginName, p);
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,4 +44,10 @@ public class TranslatedJMenu extends JMenu
|
||||||
componentReference.translate();
|
componentReference.translate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isEnabled()
|
||||||
|
{
|
||||||
|
return super.isEnabled() && getMenuComponentCount() > 0;
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in a new issue