Bug 954425 - Show status icon (and status text) for hidden conversations.

This commit is contained in:
Florian Quèze 2011-08-30 16:52:55 +02:00
Родитель 25403e68a9
Коммит eef60bda5b
2 изменённых файлов: 44 добавлений и 11 удалений

Просмотреть файл

@ -57,6 +57,9 @@
<xul:label crop="end" flex="1" mousethrough="always"
anonid="displayname" class="convDisplayName"
xbl:inherits="value=displayname"/>
<xul:label crop="end" flex="100000" mousethrough="always"
anonid="statusText" class="convStatusText"
xbl:inherits="value=statusTextWithDash"/>
<xul:label crop="end" mousethrough="always"
anonid="unreadCount" class="convUnreadCount"
xbl:inherits="value=unreadCount"/>
@ -100,7 +103,8 @@
aTopic == "update-conv-title" ||
aTopic == "update-buddy-status" ||
aTopic == "update-buddy-status" ||
aTopic == "update-conv-chatleft")
aTopic == "update-conv-chatleft" ||
aTopic == "chat-update-topic")
this.update();
else if (aTopic == "ui-conversation-closed")
this.removeNode();
@ -113,6 +117,31 @@
<![CDATA[
this.setAttribute("displayname", this.displayName);
this.setAttribute("unreadCount", this.conv.unreadIncomingMessageCount);
let statusText = "";
if (this.conv.isChat) {
if (!this.conv.account.connected || this.conv.left)
this.setAttribute("status", "left");
else {
this.removeAttribute("status");
statusText = this.conv.topic;
}
}
else {
let statusType = Ci.imIStatusInfo.STATUS_UNKNOWN;
let buddy = this.conv.buddy;
if (buddy && buddy.account.connected) {
statusText = buddy.statusText;
statusType = buddy.statusType;
}
this.setAttribute("status", Status.toAttribute(statusType));
}
if (statusText)
this.setAttribute("statusTextWithDash", " - " + statusText);
else
this.removeAttribute("statusTextWithDash");
this.setAttribute("iconPrpl",
this.conv.account.protocol.iconBaseURI + "icon.png");
]]>

Просмотреть файл

@ -98,6 +98,7 @@ contact[droptarget] > buddy[dummy] {
}
.contactStatusText,
.convStatusText,
.buddyStatusText {
color: GrayText;
}
@ -105,6 +106,7 @@ contact[droptarget] > buddy[dummy] {
.contactDisplayName,
.contactStatusText,
.convDisplayName,
.convStatusText,
.buddyDisplayName,
.buddyStatusText {
margin: 0;
@ -205,37 +207,39 @@ group label {
-moz-margin-end: 0;
}
:-moz-any(contact, buddy)[status="away"] .statusIcon,
:-moz-any(contact, buddy)[status="unavailable"] .statusIcon {
:-moz-any(conv, contact, buddy)[status="away"] .statusIcon,
:-moz-any(conv, contact, buddy)[status="unavailable"] .statusIcon {
background-image: url('chrome://instantbird/skin/away.png');
}
:-moz-any(contact, buddy)[status="idle"] .statusIcon {
:-moz-any(conv, contact, buddy)[status="idle"] .statusIcon {
background-image: url('chrome://instantbird/skin/idle.png');
}
:-moz-any(contact, buddy)[status="mobile"] .statusIcon {
:-moz-any(conv, contact, buddy)[status="mobile"] .statusIcon {
background-image: url('chrome://instantbird/skin/mobile.png');
}
:-moz-any(contact, buddy)[status="idle"] :-moz-any(.contactDisplayName, .buddyDisplayName) {
:-moz-any(contact, buddy)[status="idle"] :-moz-any(.contactDisplayName, .buddyDisplayName),
conv[status="idle"] .convDisplayName {
color: GrayText;
}
:-moz-any(contact, buddy)[status="offline"] .statusIcon {
:-moz-any(conv, contact, buddy)[status="offline"] .statusIcon,
conv[status="left"] .statusIcon {
background-image: url('chrome://instantbird/skin/offline.png');
}
:-moz-any(contact, buddy)[status="unknown"] .statusIcon {
:-moz-any(conv, contact, buddy)[status="unknown"] .statusIcon {
background-image: url('chrome://instantbird/skin/unknown.png');
}
:-moz-any(contact, buddy)[status="offline"] .protoIcon,
:-moz-any(contact, buddy)[status="unknown"] .protoIcon {
:-moz-any(conv, contact, buddy)[status="offline"] .protoIcon,
:-moz-any(conv, contact, buddy)[status="unknown"] .protoIcon {
opacity: 0.3;
}
contact[status="offline"][selected="true"] .protoIcon {
:-moz-any(conv, contact)[status="offline"][selected="true"] .protoIcon {
opacity: 0.7;
}