diff options
author | Yana Stamcheva <yana@jitsi.org> | 2006-10-06 13:25:17 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2006-10-06 13:25:17 +0000 |
commit | 9bb8f8277f20646902051723cb11dd66cecb1774 (patch) | |
tree | 856b9e95554657a662d8f4205606b652e019b36e /src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java | |
parent | 47d7fbb8ba9f188ca9463881db14c0a9b5bd4029 (diff) | |
download | jitsi-9bb8f8277f20646902051723cb11dd66cecb1774.zip jitsi-9bb8f8277f20646902051723cb11dd66cecb1774.tar.gz jitsi-9bb8f8277f20646902051723cb11dd66cecb1774.tar.bz2 |
the size of the protocol icon is fixed
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 | 25 |
1 files changed, 14 insertions, 11 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 4b09a4d..8bb3518 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 @@ -45,6 +45,8 @@ public class ContactListCellRenderer extends JPanel private boolean isLeaf = true; private MainFrame mainFrame; + + private int CONTACT_PROTOCOL_BUTTON_WIDTH = 20; /** * Initialize the panel containing the node. @@ -109,7 +111,7 @@ public class ContactListCellRenderer extends JPanel this.buttonsPanel.removeAll(); Iterator i = contactItem.getContacts(); - int buttonCount = 0; + int buttonsPanelWidth = 0; while (i.hasNext()) { Contact protocolContact = (Contact) i.next(); @@ -131,25 +133,26 @@ public class ContactListCellRenderer extends JPanel = new ContactProtocolButton(img); contactProtocolButton.setProtocolContact(protocolContact); - - contactProtocolButton.setBounds(buttonCount*16, 16, - protocolStatusIcon.getWidth(null), protocolStatusIcon - .getHeight(null)); + contactProtocolButton.setBounds(buttonsPanelWidth, + 16, + CONTACT_PROTOCOL_BUTTON_WIDTH,//the width is fixed in + //order all the icons to be with the same size + img.getHeight(null)); + + buttonsPanelWidth += CONTACT_PROTOCOL_BUTTON_WIDTH; this.buttonsPanel.add(contactProtocolButton); - buttonCount++; - toolTipText += "<br>" + protocolContact.getDisplayName(); } this.buttonsPanel.setPreferredSize( - new Dimension(buttonCount*16, 16)); + new Dimension(buttonsPanelWidth, 16)); this.buttonsPanel.setBounds( - list.getWidth() - 2 - buttonCount*16, 0, - buttonCount*16, 16); + list.getWidth() - 2 - buttonsPanelWidth, 0, + buttonsPanelWidth, 16); this.nameLabel.setBounds( - 0, 0, list.getWidth() - 2 - buttonCount*16, 17); + 0, 0, list.getWidth() - 2 - buttonsPanelWidth, 17); this.add(buttonsPanel, BorderLayout.EAST); |