Skip to content

Commit d2df40f

Browse files
committed
small ui changes
1 parent 7636d3f commit d2df40f

File tree

4 files changed

+30
-15
lines changed

4 files changed

+30
-15
lines changed

src/main/java/com/runeprofile/RuneProfilePlugin.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ protected void shutDown() {
130130

131131
@Subscribe
132132
private void onGameStateChanged(GameStateChanged state) {
133-
134-
log.info("Game state changed: {}", state.getGameState());
135133
if (state.getGameState() == GameState.LOGGED_IN) {
136134
if (!isValidWorldType(client.getWorldType())) {
137135
runeProfilePanel.loadInvalidRequestState();
Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,22 @@
11
package com.runeprofile.panels.settings;
22

33
import com.runeprofile.RuneProfilePlugin;
4-
import net.runelite.client.ui.DynamicGridLayout;
54
import net.runelite.client.ui.FontManager;
65

76
import javax.swing.*;
7+
import javax.swing.border.EmptyBorder;
88
import java.awt.*;
99

1010
public class DeleteProfilePanel extends JPanel {
1111
public DeleteProfilePanel(RuneProfilePlugin runeProfilePlugin) {
12-
setLayout(new DynamicGridLayout(0, 1, 0, 4));
12+
setLayout(new BorderLayout());
13+
14+
JPanel wrapper = new JPanel(new GridLayout(0, 1, 0, 0));
1315

1416
JLabel titleLabel = new JLabel("Delete Profile");
1517
titleLabel.setFont(FontManager.getRunescapeBoldFont());
1618
titleLabel.setForeground(Color.WHITE);
17-
add(titleLabel);
19+
wrapper.add(titleLabel);
1820

1921
// Delete profile
2022
JButton deleteProfileButton = new JButton("Delete Profile");
@@ -25,7 +27,10 @@ public DeleteProfilePanel(RuneProfilePlugin runeProfilePlugin) {
2527

2628
SwingUtilities.invokeLater(() -> deleteProfileButton.setEnabled(true));
2729
});
30+
deleteProfileButton.setBorder(new EmptyBorder(8, 16, 8, 16));
31+
32+
wrapper.add(deleteProfileButton);
2833

29-
add(deleteProfileButton);
34+
add(wrapper, BorderLayout.NORTH);
3035
}
3136
}

src/main/java/com/runeprofile/panels/settings/PrivateProfilePanel.java

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import com.runeprofile.RuneProfilePlugin;
66
import lombok.extern.slf4j.Slf4j;
77
import net.runelite.client.ui.ColorScheme;
8-
import net.runelite.client.ui.DynamicGridLayout;
98
import net.runelite.client.ui.FontManager;
109
import org.apache.commons.lang3.StringUtils;
1110

1211
import javax.swing.*;
12+
import javax.swing.border.Border;
1313
import javax.swing.border.EmptyBorder;
1414
import java.awt.*;
1515
import java.awt.datatransfer.Clipboard;
@@ -22,7 +22,11 @@ public class PrivateProfilePanel extends JPanel {
2222
private final JLabel urlLabel = new JLabel();
2323

2424
public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
25-
setLayout(new DynamicGridLayout(0, 1, 0, 4));
25+
setLayout(new BorderLayout());
26+
27+
JPanel wrapper = new JPanel(new GridLayout(0, 1, 0, 4));
28+
29+
Border buttonBorder = new EmptyBorder(8, 16, 8, 16);
2630

2731
String storedUrl = RuneProfilePlugin.getConfigManager().getRSProfileConfiguration(RuneProfileConfig.CONFIG_GROUP, RuneProfileConfig.GENERATED_PATH);
2832
privateUrl.set(storedUrl == null ? "None" : storedUrl);
@@ -31,7 +35,7 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
3135
JLabel titleLabel = new JLabel("Private Profile URL");
3236
titleLabel.setFont(FontManager.getRunescapeBoldFont());
3337
titleLabel.setForeground(Color.WHITE);
34-
add(titleLabel);
38+
wrapper.add(titleLabel);
3539

3640
String isPrivateString = RuneProfilePlugin.getConfigManager().getRSProfileConfiguration(RuneProfileConfig.CONFIG_GROUP, RuneProfileConfig.IS_PRIVATE);
3741
System.out.println("isPrivateString: " + isPrivateString);
@@ -61,7 +65,7 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
6165
SwingUtilities.invokeLater(() -> privateCheckbox.setEnabled(true));
6266
}).start();
6367
});
64-
add(privateCheckbox);
68+
wrapper.add(privateCheckbox);
6569

6670
JPanel urlContainer = new JPanel();
6771
urlContainer.setLayout(new BorderLayout());
@@ -70,15 +74,16 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
7074

7175
urlLabel.setFont(new Font("Courier New", Font.PLAIN, 11));
7276
urlContainer.add(urlLabel);
73-
add(urlContainer);
77+
wrapper.add(urlContainer);
7478

7579
JButton copyButton = new JButton("Copy");
7680
copyButton.addActionListener(e -> {
7781
StringSelection stringSelection = new StringSelection(privateUrl.get());
7882
Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
7983
clipboard.setContents(stringSelection, null);
8084
});
81-
add(copyButton);
85+
copyButton.setBorder(buttonBorder);
86+
wrapper.add(copyButton);
8287

8388
JButton newButton = new JButton("Generate New URL");
8489
newButton.addActionListener((event) -> {
@@ -95,7 +100,10 @@ public PrivateProfilePanel(RuneProfilePlugin runeProfilePlugin) {
95100
newButton.setEnabled(true);
96101
}).start();
97102
});
98-
add(newButton);
103+
newButton.setBorder(buttonBorder);
104+
wrapper.add(newButton);
105+
106+
add(wrapper, BorderLayout.NORTH);
99107
}
100108

101109
private void setNewURL(String path) {

src/main/java/com/runeprofile/panels/settings/SettingsPanel.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,21 @@
33
import com.runeprofile.RuneProfilePlugin;
44

55
import javax.swing.*;
6+
import javax.swing.border.EmptyBorder;
67
import java.awt.*;
78

89
public class SettingsPanel extends JPanel {
910
public SettingsPanel(RuneProfilePlugin runeProfilePlugin) {
1011
setLayout(new BorderLayout());
1112

12-
JPanel wrapper = new JPanel(new GridLayout(0, 1, 0, 32));
13+
JPanel wrapper = new JPanel(new GridLayout(0, 1, 0, 16));
1314

1415
wrapper.add(new PrivateProfilePanel(runeProfilePlugin));
1516
wrapper.add(new DescriptionPanel(runeProfilePlugin));
16-
wrapper.add(new DeleteProfilePanel(runeProfilePlugin));
17+
18+
DeleteProfilePanel deleteProfilePanel = new DeleteProfilePanel(runeProfilePlugin);
19+
deleteProfilePanel.setBorder(new EmptyBorder(32, 0, 0, 0));
20+
wrapper.add(deleteProfilePanel);
1721

1822
add(wrapper, BorderLayout.NORTH);
1923
}

0 commit comments

Comments
 (0)