Browse Source

This issue is caused by the desired behaviour of nimbus, the workaround offered by Sun has no effect, so I'm going to brute force a fix, which whilst horrible works nicely across all platforms.

Fixes issue 3743: nimbus LAF ignores background colour for topic bar

Change-Id: Id6274a362572b7281b39e39763463cb78e433a06
Reviewed-on: http://gerrit.dmdirc.com/866
Automatic-Compile: DMDirc Local Commits <dmdirc@googlemail.com>
Reviewed-by: Shane Mc Cormack <shane@dmdirc.com>
tags/0.6.3
Gregory Holmes 14 years ago
parent
commit
2789134c19

+ 17
- 0
src/com/dmdirc/addons/ui_swing/components/TextPaneInputField.java View File

30
 import java.awt.event.ActionEvent;
30
 import java.awt.event.ActionEvent;
31
 import java.awt.event.ActionListener;
31
 import java.awt.event.ActionListener;
32
 
32
 
33
+import javax.swing.BorderFactory;
33
 import javax.swing.JEditorPane;
34
 import javax.swing.JEditorPane;
35
+import javax.swing.plaf.ComponentUI;
36
+import javax.swing.plaf.basic.BasicEditorPaneUI;
34
 import javax.swing.text.BadLocationException;
37
 import javax.swing.text.BadLocationException;
35
 
38
 
36
 /**
39
 /**
94
     public void removeActionListener(ActionListener listener) {
97
     public void removeActionListener(ActionListener listener) {
95
         //Ignore
98
         //Ignore
96
     }
99
     }
100
+
101
+    /** {@inheritDoc} */
102
+    @Override
103
+    protected void setUI(final ComponentUI newUI) {
104
+        super.setUI(new BasicEditorPaneUI());
105
+        super.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
106
+    }
107
+
108
+    /** {@inheritDoc} */
109
+    @Override
110
+    public void updateUI() {
111
+        super.setUI(new BasicEditorPaneUI());
112
+        super.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3));
113
+    }
97
 }
114
 }

+ 1
- 1
src/com/dmdirc/addons/ui_swing/components/TopicBar.java View File

43
 import java.awt.event.ActionListener;
43
 import java.awt.event.ActionListener;
44
 import java.awt.event.MouseEvent;
44
 import java.awt.event.MouseEvent;
45
 import java.awt.event.MouseListener;
45
 import java.awt.event.MouseListener;
46
-import javax.swing.AbstractAction;
47
 
46
 
47
+import javax.swing.AbstractAction;
48
 import javax.swing.JButton;
48
 import javax.swing.JButton;
49
 import javax.swing.JComponent;
49
 import javax.swing.JComponent;
50
 import javax.swing.JLabel;
50
 import javax.swing.JLabel;

Loading…
Cancel
Save