From f1df57f9dd7574707469b944cbfef6900c461b80 Mon Sep 17 00:00:00 2001 From: Max Weber Date: Sun, 29 Aug 2021 15:36:52 -0600 Subject: [PATCH] timetracking: don't load notification icons for every panel --- .../client/plugins/timetracking/TimeablePanel.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java index 1a8b23a8fa..8903a0b715 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/timetracking/TimeablePanel.java @@ -46,6 +46,9 @@ import net.runelite.client.util.SwingUtil; @Getter public class TimeablePanel extends JPanel { + private static final ImageIcon NOTIFY_ICON = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_icon.png")); + private static final ImageIcon NOTIFY_SELECTED_ICON = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_selected_icon.png")); + private final T timeable; private final JLabel icon = new JLabel(); private final JLabel farmingContractIcon = new JLabel(); @@ -84,13 +87,10 @@ public class TimeablePanel extends JPanel infoPanel.add(text); infoPanel.add(estimate); - ImageIcon notifyIcon = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_icon.png")); - ImageIcon notifySelectedIcon = new ImageIcon(ImageUtil.loadImageResource(TimeTrackingPlugin.class, "notify_selected_icon.png")); - notifyButton.setPreferredSize(new Dimension(30, 16)); notifyButton.setBorder(new EmptyBorder(0, 0, 0, 10)); - notifyButton.setIcon(notifyIcon); - notifyButton.setSelectedIcon(notifySelectedIcon); + notifyButton.setIcon(NOTIFY_ICON); + notifyButton.setSelectedIcon(NOTIFY_SELECTED_ICON); SwingUtil.removeButtonDecorations(notifyButton); SwingUtil.addModalTooltip(notifyButton, "Disable notifications", "Enable notifications");