Added DarkLAF

I had a few issues with DarkLaf so as a backup I kept the old Darcula Theme as well.

DarkLaf is based off of Darcula so they are very similar, eventually it may be better to drop Darcula support for DarkLaf once all of the bugs are resolved.
This commit is contained in:
Konloch 2021-06-28 17:05:18 -07:00
parent db0dbdb9dc
commit 2421bd3a30

AI 샘플 코드 생성 중입니다

Loading...
5 changed files with 37 additions and 5 deletions

View File

@ -224,6 +224,11 @@
<artifactId>darcula</artifactId>
<version>2017.11bcv</version>
</dependency>
<dependency>
<groupId>com.github.weisj</groupId>
<artifactId>darklaf-core</artifactId>
<version>2.5.5</version>
</dependency>
</dependencies>
<build>

View File

@ -175,8 +175,9 @@ public class BytecodeViewer
"Make sure to watch the repo: https://github.com/Konloch/bytecode-viewer for " + VERSION + "'s release");
viewer = new MainViewerGUI();
SwingUtilities.updateComponentTreeUI(viewer);
Settings.loadSettings();
int CLI = CommandLineInput.parseCommandLine(args);
if (CLI == CommandLineInput.STOP)

View File

@ -37,6 +37,6 @@ public class Configuration
public static long lastHotKeyExecuted = System.currentTimeMillis();
public static LAFTheme lafTheme = LAFTheme.LIGHT; //lightmode by default since it uses the system theme
public static LAFTheme lafTheme = LAFTheme.SYSTEM; //lightmode by default since it uses the system theme
public static RSTATheme rstaTheme = lafTheme.getRSTATheme();
}

View File

@ -3,9 +3,11 @@ package the.bytecode.club.bytecodeviewer.gui.components;
import org.fife.ui.rsyntaxtextarea.RSyntaxTextArea;
import org.fife.ui.rtextarea.RTextScrollPane;
import the.bytecode.club.bytecodeviewer.BytecodeViewer;
import the.bytecode.club.bytecodeviewer.Configuration;
import the.bytecode.club.bytecodeviewer.Resources;
import the.bytecode.club.bytecodeviewer.gui.components.listeners.PressKeyListener;
import the.bytecode.club.bytecodeviewer.gui.components.listeners.ReleaseKeyListener;
import the.bytecode.club.bytecodeviewer.gui.theme.LAFTheme;
import the.bytecode.club.bytecodeviewer.util.JTextAreaUtils;
import javax.swing.*;
@ -44,9 +46,20 @@ public class SearchableRSyntaxTextArea extends RSyntaxTextArea
private final JTextField searchInput = new JTextField();
private final JCheckBox caseSensitiveSearch = new JCheckBox("Exact");
private final JLabel titleHeader = new JLabel("");
private final Color scrollBackground = new Color(0x3c3f41);
private final Color scrollForeground = new Color(0x575859);
public SearchableRSyntaxTextArea()
{
if(Configuration.lafTheme == LAFTheme.BETTER_DARK)
{
//this fixes the white border on the jScrollBar panes
scrollPane.getHorizontalScrollBar().setBackground(scrollBackground);
scrollPane.getHorizontalScrollBar().setForeground(scrollForeground);
scrollPane.getVerticalScrollBar().setBackground(scrollBackground);
scrollPane.getVerticalScrollBar().setForeground(scrollForeground);
}
setAntiAliasingEnabled(true);
scrollPane.setColumnHeaderView(searchPanel);

View File

@ -1,6 +1,9 @@
package the.bytecode.club.bytecodeviewer.gui.theme;
import com.bulenkov.darcula.DarculaLaf;
import com.github.weisj.darklaf.LafManager;
import com.github.weisj.darklaf.theme.DarculaTheme;
import com.github.weisj.darklaf.theme.IntelliJTheme;
import javax.swing.*;
@ -11,8 +14,10 @@ import javax.swing.*;
*/
public enum LAFTheme
{
LIGHT("Light Theme (Requires restart)", RSTATheme.DEFAULT), //System theme
DARK("Dark Theme (Requires restart)", RSTATheme.DARK), //Darcula
SYSTEM("System Theme (Fast)", RSTATheme.DEFAULT), //System theme
DARK("Dark Theme (Fast)", RSTATheme.DARK), //Darcula 2017
BETTER_DARK("Better Dark Theme (Slow)", RSTATheme.DARK), //Darcula 2021
LIGHT("Light Theme (Slow)", RSTATheme.DEFAULT), //Intellij theme
;
private final String readableName;
@ -39,13 +44,21 @@ public enum LAFTheme
switch(this)
{
default:
case LIGHT:
case SYSTEM:
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
break;
case DARK:
UIManager.setLookAndFeel(new DarculaLaf());
break;
case BETTER_DARK:
LafManager.install(new DarculaTheme());
break;
case LIGHT:
LafManager.install(new IntelliJTheme());
break;
}
}
}