[sip-comm-dev] Tab width issue


#1

Hi,
I just noticed that no matter what is the screen name length it always
gets shortened at least by four letters. This is somewhat a problem
with 4 letter nicknames, because only '...' will get displayed on chat
window tab for them. Also if I try to open new tab for person with
3-letter or shorter nickname it throws ArrayIndexOutOfBoundsException
(since it tries to do: "title.substring(0, title.length() -
4).concat("...");"). Can anyone confirm this bug?

The one fix I found is to make width returned by
SIPCommTabbedPaneEnhancedUI.calculateTabWidth() larger by WIDTHDELTA.
(However I'm not sure if that could break something else - I believe
not, but...)

Index: SIPCommTabbedPaneEnhancedUI.java
--- src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneEnhancedUI.java
Base (BASE)
+++ src/net/java/sip/communicator/util/swing/plaf/SIPCommTabbedPaneEnhancedUI.java
Locally Modified (Based On LOCAL)
@@ -393,6 +393,6 @@
                 width = PREFERRED_WIDTH;
         }

- return width;
+ return width + WIDTHDELTA;
     }
}

Cheers, Martin Harvan


#2

Hi Martin,

I just noticed that no matter what is the screen name length it always
gets shortened at least by four letters. This is somewhat a problem
with 4 letter nicknames, because only '...' will get displayed on chat
window tab for them. Also if I try to open new tab for person with
3-letter or shorter nickname it throws ArrayIndexOutOfBoundsException
(since it tries to do: "title.substring(0, title.length() -
4).concat("...");"). Can anyone confirm this bug?

I confirm the bug (using GTK L&F here)

The one fix I found is to make width returned by
SIPCommTabbedPaneEnhancedUI.calculateTabWidth() larger by WIDTHDELTA.
(However I'm not sure if that could break something else - I believe
not, but...)

... and the fix. As WIDTHDELTA is used in other calculations, I tried
several values between 0 and 20 and tabs + names still display fine.

Cheers,

···

On Fri, Feb 13, 2009 at 06:28:43PM +0100, Martin Harvan wrote:

--
Sébastien Mazy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

I confirm the bug (using GTK L&F here)

[snip]

... and the fix.

Commited and acked. Thanks, Martin.

···

On Sat, Feb 14, 2009 at 03:23:08PM +0100, Sébastien Mazy wrote:

--
Sébastien Mazy

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net