Bug 813218 - Fix padding in the Folder picker in the Toolbar widget. ui-r=bwinton, r=mkmelin
authoraceman <acelists@atlas.sk>
Mon, 10 Dec 2012 08:12:43 -0500
changeset 11676 48afd0b2360034c07a327a700151886246b43be8
parent 11675 5f82efe1e4b1fd2190c1e6c92e71b6ac89acf5dc
child 11677 566d44a1231ae01ffa6849aab7baa5f0c4cb8c7d
push id8704
push userryanvm@gmail.com
push dateMon, 10 Dec 2012 13:15:13 +0000
treeherdercomm-central@bb60be2d8d3f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbwinton, mkmelin
bugs813218
Bug 813218 - Fix padding in the Folder picker in the Toolbar widget. ui-r=bwinton, r=mkmelin
mail/base/content/extraCustomizeItems.xul
mail/themes/gnomestripe/mail/folderMenus.css
mail/themes/pinstripe/mail/folderMenus.css
mail/themes/qute/mail/folderMenus.css
mailnews/base/content/folderWidgets.xml
mailnews/extensions/newsblog/content/feed-subscriptions.xul
--- a/mail/base/content/extraCustomizeItems.xul
+++ b/mail/base/content/extraCustomizeItems.xul
@@ -67,22 +67,22 @@
                    oncommand="goDoCommand('button_compact');"
                    observes="button_compact"/>
     <toolbaritem id="folder-location-container" insert-after="button-stop"
                  title="&folderLocationToolbarItem.title;"
                  align="center"
                  class="chromeclass-toolbar-additional">
       <menulist id="locationFolders"
                 class="folderMenuItem"
-                label=" "
+                label="&folderLocationToolbarItem.title;"
                 context="folderPaneContext"
-                width="170"
+                maxwidth="300"
                 crop="center">
         <menupopup id="folderLocationPopup"
-                   class="folderLocationPopup"
+                   class="menulist-menupopup"
                    type="folder"
                    flex="1"
                    fileHereLabel="&filemessageschoosethis.label;"
                    showFileHereLabel="true"
                    oncommand="gFolderTreeView.selectFolder(event.target._folder);"/>
       </menulist>
     </toolbaritem>
     <toolbaritem id="mailviews-container"
--- a/mail/themes/gnomestripe/mail/folderMenus.css
+++ b/mail/themes/gnomestripe/mail/folderMenus.css
@@ -96,18 +96,8 @@
   -moz-image-region: rect(0px 80px 16px 64px);
 }
 
 /* Feed account node */
 .folderMenuItem[IsServer="true"][ServerType="rss"] {
   list-style-image: url("chrome://messenger/skin/icons/folder-pane.png");
   -moz-image-region: rect(32px 16px 48px 0px);
 }
-
-/* Make any sub-menu item of the folderLocationPopup act like a menuitem. */
-.folderLocationPopup menuitem,
-.folderLocationPopup menu {
-  -moz-padding-end: 30px;
-  padding-top: 0px;
-  padding-bottom: 0px;
-  max-width: none;
-  font: message-box;
-}
--- a/mail/themes/pinstripe/mail/folderMenus.css
+++ b/mail/themes/pinstripe/mail/folderMenus.css
@@ -83,18 +83,8 @@
 .folderMenuItem[IsServer="true"][ServerType="nntp"][IsSecure="true"] {
   list-style-image: url("chrome://messenger/skin/icons/server-news-lock.png");
 }
 
 /* Feed servers */
 .folderMenuItem[IsServer="true"][ServerType="rss"] {
   list-style-image: url("chrome://messenger/skin/icons/server-newsblog.png");
 }
-
-/* Make any sub-menu item of the folderLocationPopup act like a menuitem. */
-.folderLocationPopup menuitem,
-.folderLocationPopup menu {
-  -moz-padding-end: 30px;
-  padding-top: 0px;
-  padding-bottom: 0px;
-  max-width: none;
-  font: message-box;
-}
--- a/mail/themes/qute/mail/folderMenus.css
+++ b/mail/themes/qute/mail/folderMenus.css
@@ -95,18 +95,8 @@
 .folderMenuItem[IsServer="true"][ServerType="nntp"][IsSecure="true"] {
   -moz-image-region: rect(0 80px 16px 64px) !important;
 }
 
 /* Feed server */
 .folderMenuItem[IsServer="true"][ServerType="rss"] {
   list-style-image: url("chrome://messenger-newsblog/skin/icons/server-rss.png");
 }
-
-/* Make any sub-menu item of the folderLocationPopup act like a menuitem. */
-.folderLocationPopup menuitem,
-.folderLocationPopup menu {
-  -moz-padding-end: 30px;
-  padding-top: 0px;
-  padding-bottom: 0px;
-  max-width: none;
-  font: message-box;
-}
--- a/mailnews/base/content/folderWidgets.xml
+++ b/mailnews/base/content/folderWidgets.xml
@@ -26,23 +26,40 @@
         while (node instanceof XULElement) {
           if (/wrapper-.*/.test(node.id)) {
             inWrapper = true;
             break;
           }
           node = node.parentNode;
         }
         if (this.parentNode && this.parentNode.localName == "menulist" &&
-            !inWrapper)
+            !inWrapper) {
+          // If we were in a wrapper before and have a width stored, restore it now.
+          if (this.hasAttribute("original-width")) {
+            if (this.getAttribute("original-width") == "none")
+              this.removeAttribute("width");
+            else
+              this.setAttribute("width", this.getAttribute("original-width"));
+
+            this.removeAttribute("original-width");
+          }
           this._ensureInitialized();
-
+        }
         // But if we're in a wrapper, remove our children, because we're
         // getting re-created when the toolbar customization closes.
-        if (inWrapper)
+        if (inWrapper) {
           this._teardown();
+          // Store our current width and set a safe small width when we show
+          // in a wrapper.
+          if (!this.hasAttribute("original-width")) {
+            this.setAttribute("original-width", this.hasAttribute("width") ?
+                                                this.getAttribute("width") : "none");
+            this.setAttribute("width", "100");
+          }
+        }
       ]]></constructor>
       <destructor><![CDATA[
         // Clean up when being destroyed.
         this._removeListener();
       ]]></destructor>
       <!--
          - Make sure we remove our listener when the window is being destroyed
          - or the widget teared down.
--- a/mailnews/extensions/newsblog/content/feed-subscriptions.xul
+++ b/mailnews/extensions/newsblog/content/feed-subscriptions.xul
@@ -121,17 +121,17 @@
                        control="selectFolder"/>
               </hbox>
               <hbox>
                 <menulist id="selectFolder"
                           flex="1"
                           class="folderMenuItem"
                           hidden="true">
                   <menupopup id="selectFolderPopup"
-                             class="folderLocationPopup"
+                             class="menulist-menupopup"
                              type="folder"
                              mode="feeds"
                              showFileHereLabel="true"
                              showAccountsFileHere="true"
                              oncommand="FeedSubscriptions.setFolderPicker(event.target._folder)"/>
                 </menulist>
                 <textbox id="selectFolderValue"
                          flex="1"