|
@@ -46,6 +46,7 @@ import com.dmdirc.plugins.PluginDomain;
|
46
|
46
|
import com.dmdirc.ui.WindowManager;
|
47
|
47
|
import com.dmdirc.ui.messages.ColourManager;
|
48
|
48
|
import com.dmdirc.util.LogUtils;
|
|
49
|
+import java.awt.Color;
|
49
|
50
|
import java.awt.Rectangle;
|
50
|
51
|
import java.awt.event.MouseEvent;
|
51
|
52
|
import java.io.Serializable;
|
|
@@ -212,7 +213,7 @@ public class TreeFrameManager implements FrameManager, Serializable, ConfigChang
|
212
|
213
|
*/
|
213
|
214
|
public void addWindow(final MutableTreeNode parent, final TextFrame window) {
|
214
|
215
|
UIUtilities.invokeAndWait(() -> {
|
215
|
|
- final NodeLabel label = new NodeLabel(window, iconManager);
|
|
216
|
+ final NodeLabel label = new NodeLabel(window, iconManager, getForegroundColour());
|
216
|
217
|
eventBus.subscribe(label);
|
217
|
218
|
swingEventBus.subscribe(label);
|
218
|
219
|
final TreeViewNode node = new TreeViewNode(label, window);
|
|
@@ -231,11 +232,7 @@ public class TreeFrameManager implements FrameManager, Serializable, ConfigChang
|
231
|
232
|
tree.scrollRectToVisible(new Rectangle(0, (int) view.getY(), 0, 0));
|
232
|
233
|
}
|
233
|
234
|
|
234
|
|
- node.getLabel().unreadStatusChanged(new UnreadStatusChangedEvent(
|
235
|
|
- window.getContainer(),
|
236
|
|
- window.getContainer().getUnreadStatusManager(),
|
237
|
|
- window.getContainer().getUnreadStatusManager().getNotificationColour(),
|
238
|
|
- window.getContainer().getUnreadStatusManager().getUnreadLines()));
|
|
235
|
+ refreshNodeLabel(window, node);
|
239
|
236
|
node.getLabel().iconChanged(new FrameIconChangedEvent(window.getContainer(),
|
240
|
237
|
window.getContainer().getIcon()));
|
241
|
238
|
});
|
|
@@ -273,14 +270,31 @@ public class TreeFrameManager implements FrameManager, Serializable, ConfigChang
|
273
|
270
|
|
274
|
271
|
/** Sets treeview colours. */
|
275
|
272
|
private void setColours() {
|
|
273
|
+ final Color foregroundColour = getForegroundColour();
|
|
274
|
+ tree.setForeground(foregroundColour);
|
276
|
275
|
tree.setBackground(UIUtilities.convertColour(colourManager.getColourFromString(
|
277
|
276
|
config.getOptionString("treeview", "backgroundcolour", "ui",
|
278
|
277
|
"backgroundcolour"), null)));
|
279
|
|
- tree.setForeground(UIUtilities.convertColour(colourManager.getColourFromString(
|
280
|
|
- config.getOptionString("treeview", "foregroundcolour", "ui",
|
281
|
|
- "foregroundcolour"), null)));
|
282
|
|
-
|
283
|
278
|
tree.repaint();
|
|
279
|
+
|
|
280
|
+ nodes.entrySet().forEach(pair -> {
|
|
281
|
+ pair.getValue().getLabel().setDefaultForegroundColour(foregroundColour);
|
|
282
|
+ refreshNodeLabel(pair.getKey(), pair.getValue());
|
|
283
|
+ });
|
|
284
|
+ }
|
|
285
|
+
|
|
286
|
+ private Color getForegroundColour() {
|
|
287
|
+ return UIUtilities.convertColour(colourManager.getColourFromString(
|
|
288
|
+ config.getOptionString("treeview", "foregroundcolour", "ui",
|
|
289
|
+ "foregroundcolour"), null));
|
|
290
|
+ }
|
|
291
|
+
|
|
292
|
+ private void refreshNodeLabel(TextFrame window, TreeViewNode node) {
|
|
293
|
+ node.getLabel().unreadStatusChanged(new UnreadStatusChangedEvent(
|
|
294
|
+ window.getContainer(),
|
|
295
|
+ window.getContainer().getUnreadStatusManager(),
|
|
296
|
+ window.getContainer().getUnreadStatusManager().getNotificationColour(),
|
|
297
|
+ window.getContainer().getUnreadStatusManager().getUnreadLines()));
|
284
|
298
|
}
|
285
|
299
|
|
286
|
300
|
@Override
|