diff options
author | Yana Stamcheva <yana@jitsi.org> | 2006-11-27 16:30:21 +0000 |
---|---|---|
committer | Yana Stamcheva <yana@jitsi.org> | 2006-11-27 16:30:21 +0000 |
commit | 7e63ef44b369f2213af06c2790ee6c824e4e7fc4 (patch) | |
tree | e962bd0aa1d896ecc3040742e8ce4346bbb2c3c5 /src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListCellRenderer.java | |
parent | 00aa3bfcdd6ba399696e0e65f91d90b2c37cd97f (diff) | |
download | jitsi-7e63ef44b369f2213af06c2790ee6c824e4e7fc4.zip jitsi-7e63ef44b369f2213af06c2790ee6c824e4e7fc4.tar.gz jitsi-7e63ef44b369f2213af06c2790ee6c824e4e7fc4.tar.bz2 |
single click opens ang closes a group
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 | 23 |
1 files changed, 18 insertions, 5 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 2b2f542..3a5bfb2 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 @@ -35,7 +35,7 @@ public class ContactListCellRenderer extends JPanel private JLabel nameLabel = new JLabel(); private JPanel buttonsPanel; - + private SIPCommButton extendPanelButton = new SIPCommButton(ImageLoader .getImage(ImageLoader.MORE_INFO_ICON), ImageLoader .getImage(ImageLoader.MORE_INFO_ICON)); @@ -186,13 +186,26 @@ public class ContactListCellRenderer extends JPanel //this.remove(buttonsPanel); this.buttonsPanel.removeAll(); + JLabel groupContentIndicator = new JLabel(); + if(((ContactListModel)list.getModel()).isGroupClosed(groupItem)) - this.buttonsPanel.add(new JLabel(new ImageIcon(ImageLoader - .getImage(ImageLoader.CLOSED_GROUP)))); + groupContentIndicator.setIcon(new ImageIcon(ImageLoader + .getImage(ImageLoader.CLOSED_GROUP))); else - this.buttonsPanel.add(new JLabel(new ImageIcon(ImageLoader - .getImage(ImageLoader.OPENED_GROUP)))); + groupContentIndicator.setIcon(new ImageIcon(ImageLoader + .getImage(ImageLoader.OPENED_GROUP))); + //the width is fixed in + //order all the icons to be with the same size + groupContentIndicator.setBounds(0, 0, 12, 12); + this.buttonsPanel.setPreferredSize( + new Dimension(17, 16)); + this.buttonsPanel.setBounds( + list.getWidth() - 2 - 17, 0, + 17, 16); + + this.buttonsPanel.add(groupContentIndicator); + this.isLeaf = false; } |