Browse Source

Backport fix for Issue 649.

Nicklist now repaints when its config settings are changed.


git-svn-id: http://svn.dmdirc.com/branches/0.5.5@3173 00569f92-eb28-0410-84fd-f71c24880f
remotes/0.5.5
Shane Mc Cormack 16 years ago
parent
commit
f09175214d

+ 1
- 1
src/com/dmdirc/ui/swing/ChannelFrame.java View File

@@ -175,7 +175,7 @@ public final class ChannelFrame extends InputTextFrame implements MouseListener,
175 175
         
176 176
         final JScrollPane nickScrollPane = new JScrollPane();
177 177
         nickList = new JList();
178
-        nickList.setCellRenderer(new NicklistRenderer(parent.getConfigManager()));
178
+        nickList.setCellRenderer(new NicklistRenderer(parent.getConfigManager(), nickList));
179 179
         nickList.setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION);
180 180
         
181 181
         nickList.addMouseListener(this);

+ 9
- 1
src/com/dmdirc/ui/swing/NicklistRenderer.java View File

@@ -51,15 +51,21 @@ public final class NicklistRenderer extends DefaultListCellRenderer implements
51 51
     private Color altBackgroundColour;
52 52
     /** Show nick colours. */
53 53
     private boolean showColours;
54
+    /** The list that we're using for the nicklist. */
55
+    private JList nicklist;
54 56
 
55 57
     /**
56 58
      * Creates a new instance of NicklistRenderer.
57 59
      *
58 60
      * @param config ConfigManager for the associated channel
61
+     * @param nicklist The nicklist that we're rendering for.
59 62
      */
60
-    public NicklistRenderer(final ConfigManager config) {
63
+    public NicklistRenderer(final ConfigManager config, final JList nicklist) {
61 64
         super();
65
+        
62 66
         this.config = config;
67
+        this.nicklist = nicklist;
68
+        
63 69
         config.addChangeListener("ui", this);
64 70
         config.addChangeListener("nicklist", this);
65 71
 
@@ -116,11 +122,13 @@ public final class NicklistRenderer extends DefaultListCellRenderer implements
116 122
                     config.getOptionColour("ui", "nicklistbackgroundcolour",
117 123
                     config.getOptionColour("ui", "backgroundcolour",
118 124
                     Color.WHITE)));
125
+            nicklist.repaint();
119 126
         }
120 127
         if ("ui".equals(domain) && "shownickcoloursinnicklist".equals(key)) {
121 128
             showColours =
122 129
                     config.getOptionBool("ui", "shownickcoloursinnicklist",
123 130
                     false);
131
+            nicklist.repaint();
124 132
         }
125 133
     }
126 134
 }

Loading…
Cancel
Save