Parameterized contact list forground color.

cusax-fix
Yana Stamcheva 17 years ago
parent ca377085ad
commit 3739a09e82

@ -127,11 +127,23 @@ accountRegistrationBackground=C2CEE0
# Contact list contact row color.
contactListRowColor=e8e9ef
# Contact list group row color.
# Contact list group row background color.
contactListGroupRowColor=C2CEE0
# Contact list gradient group color.
contactListGroupGradientColor=C2CEE0
# Main window background color.
mainWindowBackground=FAFAFA
mainWindowBackground=FAFAFA
# Background color of the toolbar button when selected.
toolbarBackground=414141
# Rollover color for the toolbar button.
toolbarRolloverBackground=414141
# Contactlist contact text foreground color.
contactListContactForeground=000000
# Contactlist group text foreground color.
contactListGroupForeground=000000

@ -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 Component getListCellRendererComponent(JList list, Object value,
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 @@ else if (value instanceof MetaContactGroup)
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

Loading…
Cancel
Save