In the tabs of the chat window show the indicator of unread message number in the beginning of the title. This should fix hidden message number indicator for long contact names. Part from issue #632 Visual clues in chat windows about unread messages.

cusax-fix
Yana Stamcheva 17 years ago
parent 5de0ea0e9d
commit d7a4ccd899

@ -38,10 +38,11 @@ public void setSelectedIndex(int tabIndex)
return;
String tabTitle = this.getTitleAt(tabIndex);
int bracketIndex = tabTitle.indexOf("(");
int bracketIndex = tabTitle.indexOf(")");
if (bracketIndex > - 1)
tabTitle = tabTitle.substring(0, bracketIndex);
// We count the extra space after the bracket.
tabTitle = tabTitle.substring(bracketIndex + 2);
this.setTitleAt(tabIndex, tabTitle);
@ -60,13 +61,13 @@ public void setSelectedIndex(int tabIndex)
public void highlightTab(int tabIndex, int unreadMessageNumber)
{
String tabTitle = this.getTitleAt(tabIndex);
int bracketIndex = tabTitle.indexOf("(");
int bracketIndex = tabTitle.indexOf(")");
if (bracketIndex > - 1)
tabTitle = tabTitle.substring(0, bracketIndex + 1)
+ unreadMessageNumber + ")";
tabTitle = "(" + unreadMessageNumber + ")"
+ tabTitle.substring(bracketIndex + 1);
else
tabTitle = tabTitle + "(" + unreadMessageNumber + ")";
tabTitle = "(" + unreadMessageNumber + ") " + tabTitle;
this.setTitleAt(tabIndex, tabTitle);

Loading…
Cancel
Save