Browse Source

Fixes issue 3439: topic history appears to eat cpu for breakfast, lunch and dinner

Fixes issue 3438: topic history labels lose meta data

Change-Id: I1cc75e88252373ca7c7621806ef8f9a4f53bb6fd
Reviewed-on: http://gerrit.dmdirc.com/351
Reviewed-by: Chris Smith <chris@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Gregory Holmes 14 years ago
parent
commit
368351486e

+ 44
- 7
src/com/dmdirc/addons/ui_swing/dialogs/channelsetting/TopicLabel.java View File

87
         StyleConstants.setFontFamily(as, pane.getFont().getFamily());
87
         StyleConstants.setFontFamily(as, pane.getFont().getFamily());
88
         StyleConstants.setFontSize(as, pane.getFont().getSize());
88
         StyleConstants.setFontSize(as, pane.getFont().getSize());
89
         if (getBackground() == null) {
89
         if (getBackground() == null) {
90
-            StyleConstants.setBackground(as, UIManager.getColor("Table.background"));
90
+            StyleConstants.setBackground(as, UIManager.getColor(
91
+                    "Table.background"));
91
         } else {
92
         } else {
92
             StyleConstants.setBackground(as, getBackground());
93
             StyleConstants.setBackground(as, getBackground());
93
         }
94
         }
94
         if (getForeground() == null) {
95
         if (getForeground() == null) {
95
-            StyleConstants.setForeground(as, UIManager.getColor("Table.foreground"));
96
+            StyleConstants.setForeground(as, UIManager.getColor(
97
+                    "Table.foreground"));
96
         } else {
98
         } else {
97
             StyleConstants.setForeground(as, getForeground());
99
             StyleConstants.setForeground(as, getForeground());
98
         }
100
         }
104
     private void init() {
106
     private void init() {
105
         initTopicField();
107
         initTopicField();
106
         removeAll();
108
         removeAll();
107
-        setLayout(new MigLayout("fillx, ins 0, debug", "[]0[]", "[]0[]"));
109
+        setLayout(new MigLayout("fill, ins 0, debug", "[]0[]", "[]0[]"));
108
 
110
 
109
         if (!topic.getTopic().isEmpty()) {
111
         if (!topic.getTopic().isEmpty()) {
110
             Styliser.addStyledString((StyledDocument) pane.getDocument(),
112
             Styliser.addStyledString((StyledDocument) pane.getDocument(),
119
         } else {
121
         } else {
120
             label = new OldTextLabel("Topic set by " + topic.getClient());
122
             label = new OldTextLabel("Topic set by " + topic.getClient());
121
         }
123
         }
122
-        add(label, "wmax 450, growy, pushy, wrap, gapleft 5, pad 0");
124
+        add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
123
 
125
 
124
         label = new OldTextLabel("on " + new Date(topic.getTime() * 1000).
126
         label = new OldTextLabel("on " + new Date(topic.getTime() * 1000).
125
                 toString());
127
                 toString());
126
-        add(label, "wmax 450, growy, pushy, wrap, gapleft 5, pad 0");
128
+        add(label, "wmax 450, grow, push, wrap, gapleft 5, pad 0");
127
 
129
 
128
         add(new JSeparator(), "newline, span, growx, pushx");
130
         add(new JSeparator(), "newline, span, growx, pushx");
131
+
132
+        super.validate();
129
     }
133
     }
130
 
134
 
131
     /**
135
     /**
141
     @Override
145
     @Override
142
     public void setBackground(final Color bg) {
146
     public void setBackground(final Color bg) {
143
         super.setBackground(bg);
147
         super.setBackground(bg);
144
-        if (topic != null) {
148
+        if (topic != null && !bg.equals(getBackground())) {
145
             init();
149
             init();
146
         }
150
         }
147
     }
151
     }
150
     @Override
154
     @Override
151
     public void setForeground(final Color fg) {
155
     public void setForeground(final Color fg) {
152
         super.setForeground(fg);
156
         super.setForeground(fg);
153
-        if (topic != null) {
157
+        if (topic != null && !fg.equals(getForeground())) {
154
             init();
158
             init();
155
         }
159
         }
156
     }
160
     }
161
+
162
+    /** {@inheritDoc} */
163
+    @Override
164
+    public void invalidate() {
165
+    }
166
+
167
+    /** {@inheritDoc} */
168
+    @Override
169
+    public void revalidate() {
170
+    }
171
+
172
+    /** {@inheritDoc} */
173
+    @Override
174
+    public void repaint() {
175
+    }
176
+
177
+    /** {@inheritDoc} */
178
+    @Override
179
+    public void firePropertyChange(String propertyName, Object oldValue,
180
+            Object newValue) {
181
+    }
182
+
183
+    /** {@inheritDoc} */
184
+    @Override
185
+    public void firePropertyChange(String propertyName, boolean oldValue,
186
+            boolean newValue) {
187
+    }
188
+
189
+    /** {@inheritDoc} */
190
+    @Override
191
+    public void firePropertyChange(String propertyName, int oldValue,
192
+            int newValue) {
193
+    }
157
 }
194
 }

Loading…
Cancel
Save