Skip to content

Scale interface elements based on IDE Theme preferences #38

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

Merged
merged 3 commits into from
Mar 12, 2019
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
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# invalidate any other reasons why the executable file might be covered by
# the GNU General Public License.

REV=0.10.4
REV=0.10.5
ZIP_FILENAME=WiFi101-Updater-ArduinoIDE-Plugin-$REV
REQUIRED_JARS="pde.jar arduino-core.jar jssc-2.8.0-arduino2.jar bcpg-jdk15on-152.jar bcprov-jdk15on-152.jar commons-lang3-3.3.2.jar commons-codec-1.7.jar"

Expand Down
17 changes: 10 additions & 7 deletions src/cc/arduino/plugins/wifi101/UpdaterJFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@

import cc.arduino.plugins.wifi101.flashers.Flasher;
import processing.app.Base;
import processing.app.Theme;

@SuppressWarnings("serial")
public class UpdaterJFrame extends JFrame {
Expand Down Expand Up @@ -89,10 +90,12 @@ public void run() {
}

public UpdaterJFrame() {

int scale = Theme.getScale();
setTitle("WiFi101 / WiFiNINA Firmware/Certificates Updater");
setResizable(false);
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
setBounds(100, 100, 500, 520);
setBounds(100 * scale / 100, 100 * scale / 100, 500 * scale / 100, 520 * scale / 100);
contentPane = new JPanel();
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
Expand All @@ -105,8 +108,8 @@ public UpdaterJFrame() {

panel_1 = new JPanel();
panel_1.setBorder(new TitledBorder(null, "1. Select port of the WiFi module", TitledBorder.LEADING, TitledBorder.TOP, null, null));
panel_1.setMinimumSize(new Dimension(500, 150));
panel_1.setPreferredSize(new Dimension(500, 150));
panel_1.setMinimumSize(new Dimension(500 * scale / 100, 150 * scale / 100));
panel_1.setPreferredSize(new Dimension(500 * scale / 100, 150 * scale / 100));
GridBagConstraints gbc_panel_1 = new GridBagConstraints();
gbc_panel_1.insets = new Insets(5, 5, 0, 5);
gbc_panel_1.fill = GridBagConstraints.BOTH;
Expand All @@ -132,7 +135,7 @@ public UpdaterJFrame() {

serialPortList = new JList<String>();
JScrollPane sp = new JScrollPane(serialPortList);
serialPortList.setMaximumSize(new Dimension(300, 100));
serialPortList.setMaximumSize(new Dimension(300 * scale / 100, 100 * scale / 100));
GridBagConstraints gbc_serialPortList = new GridBagConstraints();
gbc_serialPortList.insets = new Insets(5, 5, 5, 5);
gbc_serialPortList.fill = GridBagConstraints.BOTH;
Expand Down Expand Up @@ -188,7 +191,7 @@ public void actionPerformed(ActionEvent e) {

panel = new JPanel();
panel.setBorder(new TitledBorder(new LineBorder(new Color(184, 207, 229)), "2. Update firmware", TitledBorder.LEADING, TitledBorder.TOP, null, new Color(51, 51, 51)));
panel.setMinimumSize(new Dimension(500, 150));
panel.setMinimumSize(new Dimension(500 * scale / 100, 150 * scale / 100));
GridBagConstraints gbc_panel = new GridBagConstraints();
gbc_panel.insets = new Insets(5, 5, 0, 5);
gbc_panel.fill = GridBagConstraints.BOTH;
Expand Down Expand Up @@ -240,7 +243,7 @@ public void actionPerformed(ActionEvent e) {

panel_2 = new JPanel();
panel_2.setBorder(new TitledBorder(null, "3. Update SSL root certificates", TitledBorder.LEFT, TitledBorder.TOP, null, null));
panel_2.setMinimumSize(new Dimension(500, 200));
panel_2.setMinimumSize(new Dimension(500 * scale / 100, 200 * scale / 100));
GridBagConstraints gbc_panel_2 = new GridBagConstraints();
gbc_panel_2.insets = new Insets(5, 5, 0, 5);
gbc_panel_2.fill = GridBagConstraints.BOTH;
Expand Down Expand Up @@ -268,7 +271,7 @@ public void actionPerformed(ActionEvent e) {
textFwNot= new JLabel();
textFwNot.setText("No certificates available");
textFwNot.setOpaque(false);
textFwNot.setMinimumSize(new Dimension(500,500));
textFwNot.setMinimumSize(new Dimension(500 * scale / 100, 500 * scale / 100));
GridBagConstraints gbc_textFwNot = new GridBagConstraints();
gbc_textFwNot.gridwidth = 2;
gbc_textFwNot.insets = new Insets(5, 5, 5, 0);
Expand Down