Pārlūkot izejas kodu

Fixes issue 3327: TopicBar uses the wrong font-colour the first time it is edited if no topic is set

Fixes issue 3326: TopicBar shouldn't reset the topic if someone else changes it whilst it is being edited.

Change-Id: I5ca1535dc9edbc9eac237f83c69efc3b910c3013
Reviewed-on: http://gerrit.dmdirc.com/248
Tested-by: Gregory Holmes <greboid@dmdirc.com>
Reviewed-by: Chris Smith <chris@dmdirc.com>
Tested-by: Chris Smith <chris@dmdirc.com>
tags/0.6.3
Gregory Holmes 14 gadus atpakaļ
vecāks
revīzija
5b126b7664

+ 6
- 0
src/com/dmdirc/addons/ui_swing/components/TopicBar.java Parādīt failu

@@ -128,6 +128,9 @@ public class TopicBar extends JComponent implements ActionListener,
128 128
         //}
129 129
         ((DefaultStyledDocument) topicText.getDocument()).setDocumentFilter(
130 130
                 new NewlinesDocumentFilter());
131
+        setAttributes();
132
+        ((DefaultStyledDocument) topicText.getDocument()).setCharacterAttributes(
133
+                0, Integer.MAX_VALUE, as, true);
131 134
 
132 135
         topicText.getActionMap().put("paste-from-clipboard",
133 136
                 new NoNewlinesPasteAction());
@@ -219,6 +222,9 @@ public class TopicBar extends JComponent implements ActionListener,
219 222
      * Topic has changed, update topic.
220 223
      */
221 224
     private void topicChanged() {
225
+        if (topicText.isEditable()) {
226
+            return;
227
+        }
222 228
         topicText.setText("");
223 229
         setAttributes();
224 230
         ((DefaultStyledDocument) topicText.getDocument()).setCharacterAttributes(

Notiek ielāde…
Atcelt
Saglabāt