Remove unnecessary headers from plugin panels
Now all plugin panels have tooltips so the headers are not necessary and most of plugins do not have them already. Signed-off-by: Tomas Slusny <slusnucky@gmail.com>
This commit is contained in:
@@ -62,7 +62,6 @@ import javax.swing.JTextArea;
|
|||||||
import javax.swing.ScrollPaneConstants;
|
import javax.swing.ScrollPaneConstants;
|
||||||
import javax.swing.SpinnerModel;
|
import javax.swing.SpinnerModel;
|
||||||
import javax.swing.SpinnerNumberModel;
|
import javax.swing.SpinnerNumberModel;
|
||||||
import javax.swing.SwingConstants;
|
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.event.ChangeListener;
|
import javax.swing.event.ChangeListener;
|
||||||
import javax.swing.event.DocumentEvent;
|
import javax.swing.event.DocumentEvent;
|
||||||
@@ -251,11 +250,6 @@ public class ConfigPanel extends PluginPanel
|
|||||||
|
|
||||||
topPanel.removeAll();
|
topPanel.removeAll();
|
||||||
mainPanel.removeAll();
|
mainPanel.removeAll();
|
||||||
|
|
||||||
JLabel title = new JLabel("Configuration", SwingConstants.LEFT);
|
|
||||||
title.setForeground(Color.WHITE);
|
|
||||||
|
|
||||||
topPanel.add(title, BorderLayout.NORTH);
|
|
||||||
topPanel.add(searchBar, BorderLayout.CENTER);
|
topPanel.add(searchBar, BorderLayout.CENTER);
|
||||||
|
|
||||||
onSearchBarChanged();
|
onSearchBarChanged();
|
||||||
|
|||||||
@@ -79,11 +79,6 @@ class FeedPanel extends PluginPanel
|
|||||||
private static final int CONTENT_WIDTH = 148;
|
private static final int CONTENT_WIDTH = 148;
|
||||||
private static final int TIME_WIDTH = 20;
|
private static final int TIME_WIDTH = 20;
|
||||||
|
|
||||||
/**
|
|
||||||
* Holds all feed items.
|
|
||||||
*/
|
|
||||||
private final JPanel feedContainer = new JPanel();
|
|
||||||
|
|
||||||
private static final Comparator<FeedItem> FEED_ITEM_COMPARATOR = (o1, o2) ->
|
private static final Comparator<FeedItem> FEED_ITEM_COMPARATOR = (o1, o2) ->
|
||||||
{
|
{
|
||||||
if (o1.getType() != o2.getType())
|
if (o1.getType() != o2.getType())
|
||||||
@@ -112,22 +107,13 @@ class FeedPanel extends PluginPanel
|
|||||||
|
|
||||||
FeedPanel(FeedConfig config, Supplier<FeedResult> feedSupplier)
|
FeedPanel(FeedConfig config, Supplier<FeedResult> feedSupplier)
|
||||||
{
|
{
|
||||||
|
super(true);
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.feedSupplier = feedSupplier;
|
this.feedSupplier = feedSupplier;
|
||||||
|
|
||||||
setBorder(new EmptyBorder(10, 10, 10, 10));
|
setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||||
setLayout(new BorderLayout());
|
setLayout(new GridLayout(0, 1, 0, 4));
|
||||||
|
|
||||||
feedContainer.setLayout(new GridLayout(0, 1, 0, 4));
|
|
||||||
feedContainer.setBackground(ColorScheme.DARK_GRAY_COLOR);
|
|
||||||
|
|
||||||
JLabel title = new JLabel("News feed");
|
|
||||||
title.setBorder(new EmptyBorder(0, 0, 9, 0));
|
|
||||||
title.setForeground(Color.WHITE);
|
|
||||||
|
|
||||||
add(title, BorderLayout.NORTH);
|
|
||||||
add(feedContainer, BorderLayout.CENTER);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void rebuildFeed()
|
void rebuildFeed()
|
||||||
@@ -141,7 +127,7 @@ class FeedPanel extends PluginPanel
|
|||||||
|
|
||||||
SwingUtilities.invokeLater(() ->
|
SwingUtilities.invokeLater(() ->
|
||||||
{
|
{
|
||||||
feedContainer.removeAll();
|
removeAll();
|
||||||
|
|
||||||
feed.getItems()
|
feed.getItems()
|
||||||
.stream()
|
.stream()
|
||||||
@@ -301,7 +287,7 @@ class FeedPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
feedContainer.add(avatarAndRight);
|
add(avatarAndRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
private String durationToString(Duration duration)
|
private String durationToString(Duration duration)
|
||||||
|
|||||||
@@ -27,7 +27,6 @@ package net.runelite.client.plugins.kourendlibrary;
|
|||||||
|
|
||||||
import com.google.inject.Inject;
|
import com.google.inject.Inject;
|
||||||
import java.awt.BorderLayout;
|
import java.awt.BorderLayout;
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.GridBagConstraints;
|
import java.awt.GridBagConstraints;
|
||||||
import java.awt.GridBagLayout;
|
import java.awt.GridBagLayout;
|
||||||
import java.awt.event.MouseAdapter;
|
import java.awt.event.MouseAdapter;
|
||||||
@@ -40,13 +39,10 @@ import java.util.Map;
|
|||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import javax.swing.BorderFactory;
|
|
||||||
import javax.swing.GroupLayout;
|
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JLabel;
|
import javax.swing.JButton;
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
import javax.swing.SwingUtilities;
|
import javax.swing.SwingUtilities;
|
||||||
import javax.swing.border.CompoundBorder;
|
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import net.runelite.client.ui.ColorScheme;
|
import net.runelite.client.ui.ColorScheme;
|
||||||
import net.runelite.client.ui.PluginPanel;
|
import net.runelite.client.ui.PluginPanel;
|
||||||
@@ -72,8 +68,7 @@ class KourendLibraryPanel extends PluginPanel
|
|||||||
|
|
||||||
void init()
|
void init()
|
||||||
{
|
{
|
||||||
GroupLayout layout = new GroupLayout(this);
|
setLayout(new BorderLayout(0, 5));
|
||||||
setLayout(layout);
|
|
||||||
setBorder(new EmptyBorder(10, 10, 10, 10));
|
setBorder(new EmptyBorder(10, 10, 10, 10));
|
||||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||||
|
|
||||||
@@ -94,7 +89,7 @@ class KourendLibraryPanel extends PluginPanel
|
|||||||
c.gridy++;
|
c.gridy++;
|
||||||
});
|
});
|
||||||
|
|
||||||
JLabel reset = new JLabel(RESET_ICON);
|
JButton reset = new JButton("Reset", RESET_ICON);
|
||||||
reset.addMouseListener(new MouseAdapter()
|
reset.addMouseListener(new MouseAdapter()
|
||||||
{
|
{
|
||||||
@Override
|
@Override
|
||||||
@@ -112,28 +107,8 @@ class KourendLibraryPanel extends PluginPanel
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
JPanel header = new JPanel();
|
add(reset, BorderLayout.NORTH);
|
||||||
header.setLayout(new BorderLayout());
|
add(books, BorderLayout.CENTER);
|
||||||
header.setBorder(new CompoundBorder(
|
|
||||||
BorderFactory.createMatteBorder(0, 0, 1, 0, new Color(58, 58, 58)),
|
|
||||||
BorderFactory.createEmptyBorder(0, 0, 10, 0)));
|
|
||||||
|
|
||||||
JLabel pluginName = new JLabel("Kourend Library Plugin");
|
|
||||||
pluginName.setForeground(Color.WHITE);
|
|
||||||
|
|
||||||
header.add(reset, BorderLayout.EAST);
|
|
||||||
header.add(pluginName, BorderLayout.CENTER);
|
|
||||||
|
|
||||||
layout.setHorizontalGroup(layout.createParallelGroup()
|
|
||||||
.addComponent(books)
|
|
||||||
.addComponent(header)
|
|
||||||
);
|
|
||||||
layout.setVerticalGroup(layout.createSequentialGroup()
|
|
||||||
.addComponent(header)
|
|
||||||
.addGap(10)
|
|
||||||
.addComponent(books)
|
|
||||||
);
|
|
||||||
|
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,25 +25,21 @@
|
|||||||
*/
|
*/
|
||||||
package net.runelite.client.plugins.notes;
|
package net.runelite.client.plugins.notes;
|
||||||
|
|
||||||
import java.awt.Color;
|
import java.awt.BorderLayout;
|
||||||
|
import java.awt.event.FocusEvent;
|
||||||
|
import java.awt.event.FocusListener;
|
||||||
import javax.swing.BorderFactory;
|
import javax.swing.BorderFactory;
|
||||||
import javax.swing.JTextArea;
|
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JPanel;
|
import javax.swing.JPanel;
|
||||||
|
import javax.swing.JTextArea;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.text.BadLocationException;
|
import javax.swing.text.BadLocationException;
|
||||||
import javax.swing.text.Document;
|
import javax.swing.text.Document;
|
||||||
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import net.runelite.client.ui.ColorScheme;
|
import net.runelite.client.ui.ColorScheme;
|
||||||
import net.runelite.client.ui.PluginPanel;
|
import net.runelite.client.ui.PluginPanel;
|
||||||
|
|
||||||
import java.awt.BorderLayout;
|
|
||||||
import java.awt.event.FocusEvent;
|
|
||||||
import java.awt.event.FocusListener;
|
|
||||||
|
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class NotesPanel extends PluginPanel
|
class NotesPanel extends PluginPanel
|
||||||
{
|
{
|
||||||
private final JTextArea notesEditor = new JTextArea();
|
private final JTextArea notesEditor = new JTextArea();
|
||||||
|
|
||||||
@@ -58,12 +54,6 @@ public class NotesPanel extends PluginPanel
|
|||||||
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
setBorder(BorderFactory.createEmptyBorder(10, 10, 10, 10));
|
||||||
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||||
|
|
||||||
final JLabel notesHeader = new JLabel("Notes");
|
|
||||||
notesHeader.setForeground(Color.WHITE);
|
|
||||||
notesHeader.setBorder(new EmptyBorder(1, 0, 10, 0));
|
|
||||||
|
|
||||||
add(notesHeader, BorderLayout.NORTH);
|
|
||||||
|
|
||||||
notesEditor.setLineWrap(true);
|
notesEditor.setLineWrap(true);
|
||||||
notesEditor.setWrapStyleWord(true);
|
notesEditor.setWrapStyleWord(true);
|
||||||
|
|
||||||
|
|||||||
@@ -26,12 +26,10 @@
|
|||||||
|
|
||||||
package net.runelite.client.plugins.skillcalculator;
|
package net.runelite.client.plugins.skillcalculator;
|
||||||
|
|
||||||
import java.awt.Color;
|
|
||||||
import java.awt.GridBagConstraints;
|
import java.awt.GridBagConstraints;
|
||||||
import java.awt.GridBagLayout;
|
import java.awt.GridBagLayout;
|
||||||
import java.awt.GridLayout;
|
import java.awt.GridLayout;
|
||||||
import javax.swing.ImageIcon;
|
import javax.swing.ImageIcon;
|
||||||
import javax.swing.JLabel;
|
|
||||||
import javax.swing.JScrollPane;
|
import javax.swing.JScrollPane;
|
||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import net.runelite.api.Client;
|
import net.runelite.api.Client;
|
||||||
@@ -71,16 +69,8 @@ class SkillCalculatorPanel extends PluginPanel
|
|||||||
final UICalculatorInputArea uiInput = new UICalculatorInputArea();
|
final UICalculatorInputArea uiInput = new UICalculatorInputArea();
|
||||||
uiInput.setBorder(new EmptyBorder(15, 0, 15, 0));
|
uiInput.setBorder(new EmptyBorder(15, 0, 15, 0));
|
||||||
uiInput.setBackground(ColorScheme.DARK_GRAY_COLOR);
|
uiInput.setBackground(ColorScheme.DARK_GRAY_COLOR);
|
||||||
|
|
||||||
uiCalculator = new SkillCalculator(client, uiInput);
|
uiCalculator = new SkillCalculator(client, uiInput);
|
||||||
|
|
||||||
JLabel title = new JLabel("Skilling Calculator");
|
|
||||||
title.setBorder(new EmptyBorder(0, 1, 8, 0));
|
|
||||||
title.setForeground(Color.WHITE);
|
|
||||||
|
|
||||||
add(title, c);
|
|
||||||
c.gridy++;
|
|
||||||
|
|
||||||
add(tabGroup, c);
|
add(tabGroup, c);
|
||||||
c.gridy++;
|
c.gridy++;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user