소스 검색

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 년 전
부모
커밋
2789134c19
2개의 변경된 파일18개의 추가작업 그리고 1개의 파일을 삭제
  1. 17
    0
      src/com/dmdirc/addons/ui_swing/components/TextPaneInputField.java
  2. 1
    1
      src/com/dmdirc/addons/ui_swing/components/TopicBar.java

+ 17
- 0
src/com/dmdirc/addons/ui_swing/components/TextPaneInputField.java 파일 보기

@@ -30,7 +30,10 @@ import com.dmdirc.ui.interfaces.InputField;
30 30
 import java.awt.event.ActionEvent;
31 31
 import java.awt.event.ActionListener;
32 32
 
33
+import javax.swing.BorderFactory;
33 34
 import javax.swing.JEditorPane;
35
+import javax.swing.plaf.ComponentUI;
36
+import javax.swing.plaf.basic.BasicEditorPaneUI;
34 37
 import javax.swing.text.BadLocationException;
35 38
 
36 39
 /**
@@ -94,4 +97,18 @@ public class TextPaneInputField extends JEditorPane implements InputField {
94 97
     public void removeActionListener(ActionListener listener) {
95 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 파일 보기

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

Loading…
취소
저장