Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modernize UI using flatlaf. #141

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions obfuscator-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
<jcp.version>6.1.4</jcp.version>
<commons-lang3.version>3.11</commons-lang3.version>
<nashorn.version>15.2</nashorn.version>
<flatlaf.version>2.1</flatlaf.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -152,6 +153,13 @@
<!--<artifactId>jscriptbox</artifactId>-->
<!--<version>3.0.0</version>-->
<!--</dependency>-->
<!-- https://mvnrepository.com/artifact/com.formdev/flatlaf -->
<dependency>
<groupId>com.formdev</groupId>
<artifactId>flatlaf</artifactId>
<version>${flatlaf.version}</version>
</dependency>


</dependencies>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import java.util.Arrays;
import java.util.List;

import com.formdev.flatlaf.FlatDarculaLaf;
import com.google.common.io.ByteStreams;
import joptsimple.OptionException;
import joptsimple.OptionParser;
Expand Down Expand Up @@ -124,7 +125,7 @@ public static void main(String[] args) throws Exception {

try {
if (Utils.isWindows()) {
UIManager.setLookAndFeel("com.bulenkov.darcula.DarculaLaf");
FlatDarculaLaf.setup();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Only applied to windows, as it seems it is project preference to use native look and feel when using other Operating Systems

} else {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="me.superblaubeere27.jobf.ui.GUI">
<grid id="27dc6" binding="panel1" default-binding="true" layout-manager="GridLayoutManager" row-count="2" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="0" left="1" bottom="0" right="1"/>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All changes here are margin changes for the main form controls

<constraints>
<xy x="20" y="20" width="884" height="518"/>
</constraints>
Expand All @@ -18,7 +18,7 @@
<border type="none"/>
<children>
<grid id="35f16" layout-manager="GridLayoutManager" row-count="6" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="5" left="5" bottom="1" right="5"/>
<constraints>
<tabbedpane title-resource-bundle="strings" title-key="input.output"/>
</constraints>
Expand Down Expand Up @@ -158,7 +158,7 @@
</children>
</grid>
<grid id="c064c" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="2" left="5" bottom="1" right="5"/>
<constraints>
<tabbedpane title="Transformers"/>
</constraints>
Expand Down Expand Up @@ -188,7 +188,7 @@
</children>
</grid>
<grid id="d3be5" layout-manager="GridLayoutManager" row-count="4" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="5" left="5" bottom="1" right="5"/>
<constraints>
<tabbedpane title="Config"/>
</constraints>
Expand Down Expand Up @@ -243,7 +243,7 @@
</children>
</grid>
<grid id="73f81" layout-manager="GridLayoutManager" row-count="1" column-count="1" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="5" left="5" bottom="1" right="5"/>
<constraints>
<tabbedpane title="Script"/>
</constraints>
Expand All @@ -252,7 +252,7 @@
<children>
<scrollpane id="7f35" class="org.fife.ui.rtextarea.RTextScrollPane">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
Expand All @@ -272,7 +272,7 @@
</children>
</grid>
<grid id="dda5b" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="5" left="5" bottom="1" right="5"/>
<constraints>
<tabbedpane title="Templates"/>
</constraints>
Expand All @@ -298,7 +298,7 @@
</children>
</grid>
<grid id="b5f51" layout-manager="GridLayoutManager" row-count="2" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<margin top="5" left="5" bottom="1" right="5"/>
<constraints>
<tabbedpane title-resource-bundle="strings" title-key="log"/>
</constraints>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,7 @@ public class GUI extends JFrame {
public GUI(String updateCheckResult) {
setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
setContentPane(panel1);
Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
setSize((int) (screenSize.getWidth() / 2), (int) (screenSize.getHeight() / 1.9));
setSize(900, 600);
setLocationRelativeTo(null);
setTitle(JObf.VERSION);

Expand Down