From 2fdded388413377269b071d9e001461391488c11 Mon Sep 17 00:00:00 2001 From: Ruben Amendoeira Date: Mon, 21 May 2018 11:45:12 +0100 Subject: [PATCH 1/5] Fix Config search bar focus Fixes #3044 - When changing the component for the search bar, anywhere on the code where focus was requested for the search bar, it was only applied to the search bar's parent container. All I had to do was override the focus requesting method and execute it for the text field. --- .../net/runelite/client/ui/components/IconTextField.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java index 0734851fb0..99e90e8bdb 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java @@ -161,6 +161,13 @@ public class IconTextField extends JPanel } } + @Override + public boolean requestFocusInWindow() + { + super.requestFocusInWindow(); + return textField.requestFocusInWindow(); + } + public Document getDocument() { return textField.getDocument(); From 90845534dd321313361a55860ccb257eee3da523 Mon Sep 17 00:00:00 2001 From: Ruben Amendoeira Date: Mon, 21 May 2018 13:10:17 +0100 Subject: [PATCH 2/5] Moved the new text selection colors globally Fixes #3042 I had new selections colors for the ge/hiscores/config search bars but forgot there were other text elements in the configs, so I moved these new colors to UI defaults (SwingUtil) Also removed some unused code that was setting styles to a combobox that never gets displayed. --- .../net/runelite/client/ui/components/IconTextField.java | 2 -- .../src/main/java/net/runelite/client/util/SwingUtil.java | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java index 99e90e8bdb..39a18486d0 100644 --- a/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java +++ b/runelite-client/src/main/java/net/runelite/client/ui/components/IconTextField.java @@ -70,8 +70,6 @@ public class IconTextField extends JPanel this.textField = new JTextField(); this.textField.setBorder(null); this.textField.setOpaque(false); - this.textField.setSelectedTextColor(Color.WHITE); - this.textField.setSelectionColor(ColorScheme.BRAND_ORANGE_TRANSPARENT); add(iconWrapperLabel, BorderLayout.WEST); add(textField, BorderLayout.CENTER); diff --git a/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java b/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java index 99a869d07e..9462c599fa 100644 --- a/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java +++ b/runelite-client/src/main/java/net/runelite/client/util/SwingUtil.java @@ -90,6 +90,12 @@ public class SwingUtil UIManager.put("MenuItem.foreground", Color.WHITE); UIManager.put("Panel.background", ColorScheme.DARK_GRAY_COLOR); UIManager.put("ScrollBarUI", CustomScrollBarUI.class.getName()); + UIManager.put("TextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); + UIManager.put("TextField.selectionForeground", Color.WHITE); + UIManager.put("FormattedTextField.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); + UIManager.put("FormattedTextField.selectionForeground", Color.WHITE); + UIManager.put("TextArea.selectionBackground", ColorScheme.BRAND_ORANGE_TRANSPARENT); + UIManager.put("TextArea.selectionForeground", Color.WHITE); // Do not render shadows under popups/tooltips. // Fixes black boxes under popups that are above the game applet. From b99911848614293f495e743940cb0f174d36b9a3 Mon Sep 17 00:00:00 2001 From: Ruben Amendoeira Date: Mon, 21 May 2018 13:27:31 +0100 Subject: [PATCH 3/5] Removed unused styling on JComboBox This was left by mistake when I was attempting to change the combobox's renderer, this element's styling is never displayed so I decided to remove it. --- .../java/net/runelite/client/plugins/config/ConfigPanel.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java index 9f6fce7f7a..72980176db 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java @@ -399,8 +399,6 @@ public class ConfigPanel extends PluginPanel if (component instanceof JComboBox) { JComboBox jComboBox = (JComboBox) component; - jComboBox.setRenderer(new ComboBoxListRenderer()); - jComboBox.setForeground(Color.WHITE); configManager.setConfiguration(cd.getGroup().keyName(), cid.getItem().keyName(), ((Enum) jComboBox.getSelectedItem()).name()); } } From b85ca418db411f99e4022ff8d6b09dfdd2230931 Mon Sep 17 00:00:00 2001 From: Ruben Amendoeira Date: Mon, 21 May 2018 16:24:15 +0100 Subject: [PATCH 4/5] Fixed exp tracker pop-up in the progress bar Fixes #2989 The interaction to open the pop-up menu contains "reset" and "open online tracker" wasn't accessible if the user clicked on the progress bar. What I did was add the component pop menu to the progress bar too. Grouped these two attributions and moved them lower on the constructor. --- .../java/net/runelite/client/plugins/xptracker/XpInfoBox.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java index b2d536e02d..f82742e342 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/xptracker/XpInfoBox.java @@ -99,7 +99,6 @@ class XpInfoBox extends JPanel popupMenu.setBorder(new EmptyBorder(5, 5, 5, 5)); popupMenu.add(openXpTracker); popupMenu.add(reset); - container.setComponentPopupMenu(popupMenu); JLabel skillIcon = new JLabel(new ImageIcon(iconManager.getSkillImage(skill))); skillIcon.setHorizontalAlignment(SwingConstants.CENTER); @@ -153,6 +152,9 @@ class XpInfoBox extends JPanel container.add(headerPanel, BorderLayout.NORTH); container.add(progressWrapper, BorderLayout.SOUTH); + container.setComponentPopupMenu(popupMenu); + progressBar.setComponentPopupMenu(popupMenu); + add(container, BorderLayout.NORTH); } From 18d600b298722e7aee9f409a8e1de9cadb458d47 Mon Sep 17 00:00:00 2001 From: Ruben Amendoeira Date: Tue, 22 May 2018 19:42:42 +0100 Subject: [PATCH 5/5] Recolour config names to white To keep consistency with the config list names, I changed the color of the specific configurations and titles to white. --- .../java/net/runelite/client/plugins/config/ConfigPanel.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java index 72980176db..7f43e6af22 100644 --- a/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java +++ b/runelite-client/src/main/java/net/runelite/client/plugins/config/ConfigPanel.java @@ -409,6 +409,7 @@ public class ConfigPanel extends PluginPanel removeAll(); String name = cd.getGroup().name() + " Configuration"; JLabel title = new JLabel(name); + title.setForeground(Color.WHITE); title.setToolTipText(cd.getGroup().description()); add(title, SwingConstants.CENTER); @@ -423,6 +424,7 @@ public class ConfigPanel extends PluginPanel item.setLayout(new BorderLayout()); name = cid.getItem().name(); JLabel configEntryName = new JLabel(name); + configEntryName.setForeground(Color.WHITE); configEntryName.setToolTipText("" + name + ":
" + cid.getItem().description() + ""); item.add(configEntryName, BorderLayout.CENTER);