diff options
author | Damian Minkov <damencho@jitsi.org> | 2014-06-05 10:21:56 +0300 |
---|---|---|
committer | Damian Minkov <damencho@jitsi.org> | 2014-06-05 10:21:56 +0300 |
commit | fe39617026eb86d7e211b9a752655ec8d9f2f7bc (patch) | |
tree | 1cbf775a85bca153299cd1608716c086c973067c /src | |
parent | 3d24d3f92da2eae06213d63ca190b42078b473ce (diff) | |
download | jitsi-fe39617026eb86d7e211b9a752655ec8d9f2f7bc.zip jitsi-fe39617026eb86d7e211b9a752655ec8d9f2f7bc.tar.gz jitsi-fe39617026eb86d7e211b9a752655ec8d9f2f7bc.tar.bz2 |
Calculates buttons height before the button is rendered in contactlist renderer.
Diffstat (limited to 'src')
-rw-r--r-- | src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java index ea663cf..cb28d5f 100644 --- a/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java +++ b/src/net/java/sip/communicator/impl/gui/main/contactlist/ContactListTreeCellRenderer.java @@ -602,14 +602,18 @@ public class ContactListTreeCellRenderer = ComponentUtils.getStringHeight(nameLabel) + V_GAP + ComponentUtils.getStringHeight(displayDetailsLabel); - } - if(preferredSelectedContactNodeHeight == null && isSelected) - { + // load button height, before button is even shown + // will be the same as the image + int buttonHeight = 27; + Image img = ImageLoader.getImage(ImageLoader.CHAT_BUTTON_SMALL); + if(img != null) + buttonHeight = img.getHeight(chatButton); + preferredSelectedContactNodeHeight = preferredNotSelectedContactNodeHeight + V_GAP - + chatButton.getHeight(); + + buttonHeight; } } else if (value instanceof GroupNode) |