diff options
author | Yana Stamcheva <yana@jitsi.org> | 2008-10-10 14:34:54 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2008-10-10 14:34:54 +0000 |
commit | 3739a09e82355d7df57d52a212c8f4497e4af05f (patch) | |
tree | 2a2242aaa6d97fefba08be3586cd634daf588726 /src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java | |
parent | ca377085ade90fa237b169117abad105916c2440 (diff) | |
download | jitsi-3739a09e82355d7df57d52a212c8f4497e4af05f.zip jitsi-3739a09e82355d7df57d52a212c8f4497e4af05f.tar.gz jitsi-3739a09e82355d7df57d52a212c8f4497e4af05f.tar.bz2 |
Parameterized contact list forground color.
Diffstat (limited to 'src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java index 9553640..1da9ac9 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java @@ -41,6 +41,10 @@ public class ContactListCellRenderer private static final int AVATAR_WIDTH = 30; + private Color groupForegroundColor; + + private Color contactForegroundColor; + private JLabel nameLabel = new JLabel(); private JLabel photoLabel = new JLabel(); @@ -62,10 +66,22 @@ public class ContactListCellRenderer /** * Initialize the panel containing the node. */ - public ContactListCellRenderer(MainFrame mainFrame) { - + public ContactListCellRenderer(MainFrame mainFrame) + { super(new BorderLayout()); + int groupForegroundProperty = GuiActivator.getResources() + .getColor("contactListGroupForeground"); + + if (groupForegroundProperty > -1) + groupForegroundColor = new Color (groupForegroundProperty); + + int contactForegroundProperty = GuiActivator.getResources() + .getColor("contactListContactForeground"); + + if (contactForegroundProperty > -1) + contactForegroundColor = new Color(contactForegroundProperty); + this.mainFrame = mainFrame; buttonsPanel = new JPanel(); @@ -123,6 +139,9 @@ public class ContactListCellRenderer this.nameLabel.setFont(this.getFont().deriveFont(Font.PLAIN)); + if (contactForegroundColor != null) + this.nameLabel.setForeground(contactForegroundColor); + this.setBorder(BorderFactory.createEmptyBorder(1, 5, 1, 1)); byte[] avatar = contactItem.getAvatar(true); @@ -163,6 +182,9 @@ public class ContactListCellRenderer this.nameLabel.setFont(this.getFont().deriveFont(Font.BOLD)); + if (groupForegroundColor != null) + this.nameLabel.setForeground(groupForegroundColor); + this.setBorder(BorderFactory.createEmptyBorder(2, 5, 2, 2)); // We should set the bounds of the cell explicitely in order to |