Commit 214866fc authored by Jan Peter Stotz's avatar Jan Peter Stotz

chore: About box and logos

parent 7654661b
......@@ -2,9 +2,11 @@ package jadx.gui.ui;
import javax.swing.*;
import java.awt.*;
import java.net.URL;
import jadx.api.JadxDecompiler;
import jadx.gui.utils.NLS;
import jadx.gui.utils.Utils;
class AboutDialog extends JDialog {
private static final long serialVersionUID = 5763493590584039096L;
......@@ -16,7 +18,10 @@ class AboutDialog extends JDialog {
public final void initUI() {
Font font = new Font("Serif", Font.BOLD, 13);
JLabel name = new JLabel("jadx");
URL logoURL = getClass().getResource("/logos/jadx-logo-48px.png");
Icon logo = new ImageIcon(logoURL, "jadx logo");
JLabel name = new JLabel("jadx", logo, SwingConstants.CENTER);
name.setFont(font);
name.setAlignmentX(0.5f);
......@@ -24,10 +29,24 @@ class AboutDialog extends JDialog {
desc.setFont(font);
desc.setAlignmentX(0.5f);
JLabel version = new JLabel("version: " + JadxDecompiler.getVersion());
JLabel version = new JLabel("jadx version: " + JadxDecompiler.getVersion());
version.setFont(font);
version.setAlignmentX(0.5f);
String javaVm = System.getProperty("java.vm.name");
String javaVer = System.getProperty("java.vm.version");
javaVm = javaVm == null ? "" : javaVm;
JLabel javaVmLabel = new JLabel("Java VM: " + javaVm);
javaVmLabel.setFont(font);
javaVmLabel.setAlignmentX(0.5f);
javaVer = javaVer == null ? "" : javaVer;
JLabel javaVerLabel = new JLabel("Java version: " + javaVer);
javaVerLabel.setFont(font);
javaVerLabel.setAlignmentX(0.5f);
JPanel textPane = new JPanel();
textPane.setBorder(BorderFactory.createEmptyBorder(15, 15, 15, 15));
textPane.setLayout(new BoxLayout(textPane, BoxLayout.PAGE_AXIS));
......@@ -38,6 +57,9 @@ class AboutDialog extends JDialog {
textPane.add(Box.createRigidArea(new Dimension(0, 10)));
textPane.add(version);
textPane.add(Box.createRigidArea(new Dimension(0, 20)));
textPane.add(javaVmLabel);
textPane.add(javaVerLabel);
textPane.add(Box.createRigidArea(new Dimension(0, 20)));
JButton close = new JButton(NLS.str("tabs.close"));
close.addActionListener(event -> dispose());
......@@ -47,6 +69,8 @@ class AboutDialog extends JDialog {
contentPane.add(textPane, BorderLayout.CENTER);
contentPane.add(close, BorderLayout.PAGE_END);
Utils.setWindowIcons(this);
setModalityType(ModalityType.APPLICATION_MODAL);
setTitle(NLS.str("about_dialog.title"));
......
......@@ -82,6 +82,7 @@ public class MainWindow extends JFrame {
private static final ImageIcon ICON_PREF = Utils.openIcon("wrench");
private static final ImageIcon ICON_DEOBF = Utils.openIcon("lock_edit");
private static final ImageIcon ICON_LOG = Utils.openIcon("report");
private static final ImageIcon ICON_JADX = Utils.openIcon("jadx-logo");
private final transient JadxWrapper wrapper;
private final transient JadxSettings settings;
......@@ -116,16 +117,7 @@ public class MainWindow extends JFrame {
registerBundledFonts();
initUI();
initMenuAndToolbar();
setWindowIcons();
}
private void setWindowIcons() {
List<Image> icons = new ArrayList<>();
icons.add(Utils.openImage("/logos/jadx-logo-16px.png"));
icons.add(Utils.openImage("/logos/jadx-logo-32px.png"));
icons.add(Utils.openImage("/logos/jadx-logo-48px.png"));
icons.add(Utils.openImage("/logos/jadx-logo.png"));
setIconImages(icons);
Utils.setWindowIcons(this);
loadSettings();
checkForUpdate();
}
......@@ -462,7 +454,7 @@ public class MainWindow extends JFrame {
logAction.putValue(Action.ACCELERATOR_KEY, getKeyStroke(KeyEvent.VK_L,
KeyEvent.CTRL_DOWN_MASK | KeyEvent.SHIFT_DOWN_MASK));
Action aboutAction = new AbstractAction(NLS.str("menu.about")) {
Action aboutAction = new AbstractAction(NLS.str("menu.about"), ICON_JADX) {
@Override
public void actionPerformed(ActionEvent e) {
new AboutDialog().setVisible(true);
......
......@@ -7,6 +7,8 @@ import java.awt.datatransfer.StringSelection;
import java.awt.datatransfer.Transferable;
import java.io.InputStream;
import java.net.URL;
import java.util.ArrayList;
import java.util.List;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
......@@ -191,4 +193,13 @@ public class Utils {
}
return sb.toString().trim();
}
public static void setWindowIcons(Window window) {
List<Image> icons = new ArrayList<>();
icons.add(Utils.openImage("/logos/jadx-logo-16px.png"));
icons.add(Utils.openImage("/logos/jadx-logo-32px.png"));
icons.add(Utils.openImage("/logos/jadx-logo-48px.png"));
icons.add(Utils.openImage("/logos/jadx-logo.png"));
window.setIconImages(icons);
}
}
<svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 252.23 252"><defs><style>.cls-1,.cls-14{fill:none;}.cls-2{fill:#231f20;}.cls-3{fill:#461bbc;}.cls-4{clip-path:url(#clip-path);}.cls-5{clip-path:url(#clip-path-2);}.cls-6{fill:#008275;}.cls-7{font-size:132.44px;}.cls-12,.cls-7{fill:#fff;font-family:FuturaPT-Heavy, Futura PT;}.cls-8{letter-spacing:-0.03em;}.cls-9{clip-path:url(#clip-path-3);}.cls-10{fill:#f15a29;}.cls-11{fill:#9e1f63;}.cls-12{font-size:134.04px;letter-spacing:-0.01em;}.cls-13{letter-spacing:0em;}.cls-14{stroke:#fff;stroke-miterlimit:10;stroke-width:8.91px;}</style><clipPath id="clip-path" transform="translate(0.23)"><circle class="cls-1" cx="126" cy="126" r="125.72"/></clipPath><clipPath id="clip-path-2" transform="translate(0.23)"><polygon class="cls-1" points="45.29 223.57 176.25 75.9 258.09 69.98 258.09 242.47 45.29 242.47 45.29 223.57"/></clipPath><clipPath id="clip-path-3" transform="translate(0.23)"><polygon class="cls-1" points="57.93 195.53 179.7 63.23 69.69 5.58 3.53 19.58 -15.33 132.35 57.93 195.53"/></clipPath></defs><title>jadxlogo</title><circle class="cls-2" cx="126.23" cy="126" r="126"/><path class="cls-3" d="M122.66-68.19" transform="translate(0.23)"/><g class="cls-4"><g class="cls-5"><polygon class="cls-3" points="198.71 223.57 37.48 223.57 142.14 105.88 198.71 223.57"/><polygon class="cls-6" points="170.52 74.83 238.84 87.48 247.15 198.65 190.4 207.09 142.14 105.88 170.52 74.83"/><text class="cls-7" transform="translate(82.68 208.04) scale(0.95 1)"><tspan class="cls-8">D</tspan><tspan x="86.48" y="0">X</tspan></text></g><g class="cls-9"><polyline class="cls-10" points="73.68 193.85 0 126.28 140.52 53.49 171.12 88.7"/><polyline class="cls-11" points="30.86 19.58 30.86 110.86 129.83 59.59 160.42 94.8 181.86 67.19"/><text class="cls-12" transform="translate(10.71 121.84) scale(1.01 1)">J<tspan class="cls-13" x="54.29" y="0">A</tspan></text></g></g><circle class="cls-14" cx="126.08" cy="125.86" r="120.86"/></svg>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment