Bug 1084109 - displayStatusText() is not implemented in Thunderbird r=aleth ui-r=richard.marti
authorMatthew Sotoudeh <matthewsot@outlook.com>
Mon, 10 Nov 2014 21:16:00 -0500
changeset 17058 ed470ac5123a4f29b7817f676eaecb98a9066a16
parent 17057 33fc1b3eb2b0c249a177ec51a9d767413b7e8bdc
child 17059 a01fb28145bc8fd9bcc95b56d0ee0a20600df6b0
push id10575
push userclokep@gmail.com
push dateTue, 11 Nov 2014 20:41:03 +0000
treeherdercomm-central@4dd3954fe924 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaleth, richard
bugs1084109
Bug 1084109 - displayStatusText() is not implemented in Thunderbird r=aleth ui-r=richard.marti
mail/components/im/content/imconversation.xml
mail/components/im/themes/chat.css
mail/themes/osx/mail/chat.css
mail/themes/windows/mail/chat-aero.css
--- a/mail/components/im/content/imconversation.xml
+++ b/mail/components/im/content/imconversation.xml
@@ -26,16 +26,19 @@
               <xul:browser anonid="browser" type="content-conversation" flex="1"
                            xbl:inherits="tooltip=contenttooltip,contextmenu=contentcontextmenu,autoscrollpopup"/>
               <xul:progressmeter anonid="browserProgress" hidden="true"/>
               <xul:findbar anonid="FindToolbar" reversed="true"/>
             </xul:vbox>
           </xul:notificationbox>
         </xul:hbox>
         <xul:splitter class="splitter" anonid="splitter-bottom"/>
+        <hbox anonid="convStatusContainer" class="conv-status-container" hidden="true">
+          <xul:description anonid="convStatus" class="plain conv-status" crop="end" />
+        </hbox>
         <xul:stack anonid="conv-bottom" class="conv-bottom">
           <xul:textbox anonid="inputBox" class="conv-textbox" multiline="true" flex="1"/>
           <xul:description anonid="charCounter" class="conv-counter" value="" right="0" bottom="0"/>
         </xul:stack>
       </xul:vbox>
     </content>
     <implementation implements="nsIObserver">
      <constructor>
@@ -117,18 +120,29 @@
         let messages = this._conv.getMessages();
         this._readCount = messages.length - this._conv.unreadMessageCount;
         messages.forEach(this.addMsg.bind(this));
       ]]>
       </body>
      </method>
 
      <field name="_statusText">""</field>
-     <field name="_statusTextEnd">""</field>
-     <field name="_statusTextEndIsError">false</field>
+     <method name="displayStatusText">
+       <body>
+       <![CDATA[
+         let convStatusContainer = this.getElt("convStatusContainer");
+         let convStatus = this.getElt("convStatus");
+         convStatus.value = this._statusText;
+         if (this._statusText.length)
+           convStatusContainer.removeAttribute("hidden");
+         else
+           convStatusContainer.setAttribute("hidden", "true");
+       ]]>
+       </body>
+     </method>
 
      <method name="addMsg">
       <parameter name="aMsg"/>
       <body>
       <![CDATA[
         if (!this.loaded)
           throw "Calling addMsg before the browser is ready?";
 
@@ -547,17 +561,16 @@
               // 200 is a 'magic' constant to avoid showing big numbers.
               charCounter.setAttribute("value", (left < 200 ? left : ""));
 
               if (left >= 0)
                 inputBox.removeAttribute("invalidInput");
               else if (left < 0)
                 inputBox.setAttribute("invalidInput", "true");
             }
-            this.displayStatusText();
           }).bind(this), 0);
           return;
         }
 
         if (!event.ctrlKey && !event.shiftKey && !event.altKey) {
           // Prevent the default action before calling sendMsg to avoid having
           // a line break inserted in the textbox if sendMsg throws.
           event.preventDefault();
@@ -572,18 +585,17 @@
      <method name="resetInput">
       <body>
       <![CDATA[
         var inputBox = this.editor;
         inputBox.value = "";
         this.getElt("charCounter").setAttribute("value", "");
         inputBox.removeAttribute("invalidInput");
 
-        this._statusTextEnd = "";
-        this._statusTextEndIsError = false;
+        this._statusText = "";
         this.displayStatusText();
 
         let overflow = "";
         if (TextboxSize.autoResize) {
           let currHeight = parseInt(inputBox.parentNode.height);
           if (inputBox.defaultHeight + this._TEXTBOX_VERTICAL_OVERHEAD > currHeight)
             inputBox.defaultHeight = currHeight - this._TEXTBOX_VERTICAL_OVERHEAD;
           this.getElt("conv-bottom").height =
@@ -999,45 +1011,29 @@
        ]]>
        </body>
      </method>
 
      <method name="focus">
        <body>
        <![CDATA[
          this.editor.focus();
-         this.displayStatusText();
+
          if (!this.loaded)
            return;
 
          if (this.tab) {
            this.tab.removeAttribute("unread");
            this.tab.removeAttribute("attention");
          }
          this._conv.markAsRead();
        ]]>
        </body>
      </method>
 
-     <method name="displayStatusText">
-       <body>
-       <![CDATA[
-         if (this.tab && !this.tab.selected)
-           return;
-
-         if ("XULBrowserWindow" in window) {
-           window.XULBrowserWindow.setStatus(this._statusText);
-           if ("setStatusEnd" in window.XULBrowserWindow)
-             window.XULBrowserWindow.setStatusEnd(this._statusTextEnd,
-                                                  this._statusTextEndIsError);
-         }
-       ]]>
-       </body>
-     </method>
-
      <method name="updateTyping">
        <body>
        <![CDATA[
           let typingState = this._conv.typingState;
           let cti = document.getElementById("conv-top-info");
           cti.removeAttribute("typing");
           cti.removeAttribute("typed");
 
@@ -1087,21 +1083,18 @@
             cti.setAttribute("displayName", this._conv.title);
           }
           else {
             let displayName = this._conv.title;
             let statusText = "";
             let statusType = Ci.imIStatusInfo.STATUS_UNKNOWN;
 
             let buddy = this._conv.buddy;
-            if (!buddy || !buddy.account.connected) {
-              this._statusText = "";
-              this.displayStatusText();
+            if (!buddy || !buddy.account.connected)
               cti.removeAttribute("userIcon");
-            }
             else {
               displayName = buddy.displayName;
               statusText = buddy.statusText;
               statusType = buddy.statusType;
               cti.setAttribute("userIcon", buddy.buddyIconFilename);
             }
 
             cti.setAttribute("displayName", displayName);
--- a/mail/components/im/themes/chat.css
+++ b/mail/components/im/themes/chat.css
@@ -300,16 +300,37 @@ imcontact[aliasing] .contactDisplayName 
 }
 
 %ifndef XP_MACOSX
 .conv-messages[chat] {
   border-right: solid 1px GrayText;
 }
 %endif
 
+
+/* Animation copied from the find bar in Firefox - http://dxr.mozilla.org/mozilla-central/source/toolkit/themes/linux/global/findBar.css#7 */
+.conv-status-container {
+  display: block;
+  height: 20px;
+  padding: 3px;
+  border-bottom: 1px solid ThreeDShadow;
+  transition-property: margin-top, opacity, visibility;
+  transition-duration: 150ms, 150ms, 0s;
+  transition-timing-function: ease-in-out, ease-in-out, linear;
+}
+
+.conv-status-container[hidden] {
+  /* Override display:none to make the transition work. */
+  display: -moz-box;
+  visibility: collapse;
+  margin-top: -1em;
+  opacity: 0;
+  transition-delay: 0s, 0s, 150ms;
+}
+
 %ifdef XP_MACOSX
 .conv-textbox {
   -moz-appearance: none;
   margin: 0;
   padding: 3px;
   border: none;
   box-shadow: inset 0 1px 3px 0px rgba(0, 0, 0, 0.6);
 }
--- a/mail/themes/osx/mail/chat.css
+++ b/mail/themes/osx/mail/chat.css
@@ -54,16 +54,20 @@
   width: 5px;
   /* make only the splitter border visible */
   -moz-margin-start: -4px;
   /* because of the negative margin needed to make the splitter visible */
   position: relative;
   z-index: 10;
 }
 
+.conv-status-container {
+  border-bottom-color: #8B8B8B;
+}
+
 /* Adaptation of #folderPaneBox/#folderPaneTree from osx/mail/mailWindow1.css */
 #listPaneBox {
   -moz-appearance: -moz-mac-vibrancy-light;
   background-color: #DEE4EA !important;
 }
 
 #listPaneBox:-moz-window-inactive {
   background-color: #E8E8E8 !important;
--- a/mail/themes/windows/mail/chat-aero.css
+++ b/mail/themes/windows/mail/chat-aero.css
@@ -67,16 +67,20 @@
 
 .conv-top,
 .conv-bottom,
 #logDisplay {
   border: none;
 }
 
 @media (-moz-windows-default-theme) {
+  .conv-status-container {
+    border-bottom-color: #A9B7C9;
+  }
+
   #statusTypeIcon .toolbarbutton-menu-dropmarker {
     padding: 1px 3px;
     list-style-image: url("chrome://messenger/skin/icons/toolbarbutton-arrow.png");
   }
 
   #chat-status-selector:hover > .statusMessageToolbarItem,
   .statusMessageToolbarItem:focus {
     border-color: hsla(210, 54%, 20%, .25) hsla(210, 54%, 20%, .27)