From 90845534dd321313361a55860ccb257eee3da523 Mon Sep 17 00:00:00 2001 From: Ruben Amendoeira Date: Mon, 21 May 2018 13:10:17 +0100 Subject: [PATCH] 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.