Bug 554237: Dual vertical scrollbars if any type of add-ons exceed window area. r=unfocused
authorDave Townsend <dtownsend@oxymoronical.com>
Wed, 12 May 2010 10:26:04 -0700
changeset 42213 b28ec304976f4a1df9222a23b8b2165a8ccae299
parent 42212 d9900a280f59015e6e02ba196eba2bd2146fb12c
child 42214 6553164731ac521bc87c119a0fdd0d3b29d79ccf
push id13231
push userdtownsend@mozilla.com
push dateWed, 12 May 2010 18:10:09 +0000
treeherdermozilla-central@b28ec304976f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersunfocused
bugs554237
milestone1.9.3a5pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 554237: Dual vertical scrollbars if any type of add-ons exceed window area. r=unfocused
toolkit/mozapps/extensions/content/extensions.js
toolkit/mozapps/extensions/content/extensions.xul
toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
toolkit/themes/pinstripe/mozapps/extensions/extensions.css
toolkit/themes/winstripe/mozapps/extensions/extensions.css
--- a/toolkit/mozapps/extensions/content/extensions.js
+++ b/toolkit/mozapps/extensions/content/extensions.js
@@ -753,36 +753,38 @@ var gSearchView = {
 
   show: function(aQuery) {
     gHeader.setName(gStrings.ext.GetStringFromName("header-search"));
     this.showEmptyNotice(false);
 
     gHeader.searchQuery = aQuery;
     aQuery = aQuery.trim().toLocaleLowerCase();
 
-    while (this._listBox.itemCount > 0)
-      this._listBox.removeItemAt(0);
+    while (this._listBox.lastChild.localName == "richlistitem")
+      this._listBox.removeChild(this._listBox.lastChild);
 
     var self = this;
     AddonManager.getAddonsByTypes(null, function(aAddonsList) {
+      var elementCount = 0;
       for (let i = 0; i < aAddonsList.length; i++) {
         let addon = aAddonsList[i];
         let score = 0;
         if (aQuery.length > 0) {
           score = self.getMatchScore(addon, aQuery);
           if (score == 0)
             continue;
         }
 
         let item = createItem(addon);
         item.setAttribute("relevancescore", score);
         self._listBox.appendChild(item);
+        elementCount++;
       }
 
-      if (self._listBox.childElementCount > 0)
+      if (elementCount > 0)
         self.onSortChanged("relevancescore", false);
       else
         self.showEmptyNotice(true);
 
       gViewController.updateCommands();
     });
   },
 
@@ -826,24 +828,26 @@ var gSearchView = {
     if (needles.length > 1 && aStr.indexOf(aQuery) != -1)
       score += needles.length;
 
     return score * aMultiplier;
   },
 
   showEmptyNotice: function(aShow) {
     this._emptyNotice.hidden = !aShow;
-    this._listBox.collasped = aShow;
   },
 
   onSortChanged: function(aSortBy, aAscending) {
+    var header = this._listBox.firstChild;
+    this._listBox.removeChild(header);
     var sortService = Cc["@mozilla.org/xul/xul-sort-service;1"].
                       getService(Ci.nsIXULSortService);
     sortService.sort(this._listBox, aSortBy,
                      aAscending ? "ascending" : "descending");
+    this._listBox.insertBefore(header, this._listBox.firstChild);
   },
 
   getSelectedAddon: function() {
     var item = this._listBox.selectedItem;
     if (item)
       return item.mAddon;
     return null;
   }
@@ -933,17 +937,16 @@ var gListView = {
   },
 
   hide: function() {
     gEventManager.unregisterInstallListener(this);
   },
 
   showEmptyNotice: function(aShow) {
     this._emptyNotice.hidden = !aShow;
-    this._listBox.collasped = aShow;
   },
 
   onSortChanged: function(aSortBy, aAscending) {
     var sortService = Cc["@mozilla.org/xul/xul-sort-service;1"].
                       getService(Ci.nsIXULSortService);
     sortService.sort(this._listBox, aSortBy,
                      aAscending ? "ascending" : "descending");
   },
--- a/toolkit/mozapps/extensions/content/extensions.xul
+++ b/toolkit/mozapps/extensions/content/extensions.xul
@@ -167,54 +167,53 @@
         </vbox>
 
         <!-- search view -->
         <vbox id="search-view" flex="1" class="view-pane">
           <hbox class="view-header" pack="end">
             <hbox id="search-sorters" class="sort-controls" sortby="name"
                   ascending="true"/>
           </hbox>
-          <vbox class="list-container" flex="1">
-            <hbox class="search-filter">
-              <label value="&search.filter.label;"/>
-              <checkbox id="search-filter-local" checked="true" disabled="true"
-                        label="&search.filter.installed.label;"/>
-              <checkbox id="search-filter-remote"
-                        checked="false" disabled="true"
-                        label="&search.filter.available.label;"/>
-            </hbox>
-            <vbox id="search-list-empty" class="empty-list-notice"
-                  flex="1" hidden="true">
-              <spacer flex="1"/>
-              <label value="&listEmpty.search.label;"/>
-              <button label="&listEmpty.button.label;" class="addon-control"
-                      command="cmd_goToDiscoverPane"/>
-              <spacer flex="3"/>
+          <richlistbox id="search-list" class="list" flex="1">
+            <vbox flex="1">
+              <hbox class="search-filter">
+                <label value="&search.filter.label;"/>
+                <checkbox id="search-filter-local" checked="true" disabled="true"
+                          label="&search.filter.installed.label;"/>
+                <checkbox id="search-filter-remote"
+                          checked="false" disabled="true"
+                          label="&search.filter.available.label;"/>
+              </hbox>
+              <vbox id="search-list-empty" class="empty-list-notice"
+                    flex="1" hidden="true">
+                <spacer flex="1"/>
+                <label value="&listEmpty.search.label;"/>
+                <button label="&listEmpty.button.label;" class="addon-control"
+                        command="cmd_goToDiscoverPane"/>
+                <spacer flex="3"/>
+              </vbox>
             </vbox>
-            <richlistbox id="search-list" class="list"/>
-          </vbox>
+          </richlistbox>
         </vbox>
 
         <!-- list view -->
         <vbox id="list-view" flex="1" class="view-pane">
           <hbox class="view-header" pack="end">
             <hbox id="list-sorters" class="sort-controls" sortby="name"
                   ascending="true"/>
           </hbox>
-          <vbox class="list-container" flex="1">
-            <vbox id="addon-list-empty" class="empty-list-notice"
-                  flex="1" hidden="true">
-              <spacer flex="1"/>
-              <label value="&listEmpty.installed.label;"/>
-              <button label="&listEmpty.button.label;" class="addon-control"
-                      command="cmd_goToDiscoverPane"/>
-              <spacer flex="3"/>
-            </vbox>
-            <richlistbox id="addon-list" class="list"/>
+          <vbox id="addon-list-empty" class="empty-list-notice"
+                flex="1" hidden="true">
+            <spacer flex="1"/>
+            <label value="&listEmpty.installed.label;"/>
+            <button label="&listEmpty.button.label;" class="addon-control"
+                    command="cmd_goToDiscoverPane"/>
+            <spacer flex="3"/>
           </vbox>
+          <richlistbox id="addon-list" class="list" flex="1"/>
         </vbox>
 
         <!-- detail view -->
         <hbox id="detail-view" flex="1" class="view-pane">
           <spacer flex="1"/>
           <!-- "loading" splash screen -->
           <hbox class="loading" flex="1">
             <image/>
--- a/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/gnomestripe/mozapps/extensions/extensions.css
@@ -215,20 +215,16 @@
 
 .empty-list-notice > button {
   margin: 20px;
 }
 
 
 /*** list ***/
 
-.list-container {
-  overflow: auto;
-}
-
 .list {
   -moz-appearance: none;
   margin: 0px;
   border: none;
 }
 
 .addon[status="installed"], .addon[status="installing"] {
   background-color: #FCFCFC;
@@ -393,17 +389,17 @@
 .addon[status="uninstalled"][selected] {
   background-color: transparent;
 }
 
 
 
 /*** search view ***/
 
-#search-view > .list-container > .search-filter {
+.search-filter {
   padding: 20px;
   -moz-box-align: center;
   background-color: #FFF;
   font-size: 120%;
 }
 
 
 /*** detail view ***/
--- a/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/pinstripe/mozapps/extensions/extensions.css
@@ -215,20 +215,16 @@
 
 .empty-list-notice > button {
   margin: 20px;
 }
 
 
 /*** list ***/
 
-.list-container {
-  overflow: auto;
-}
-
 .list {
   -moz-appearance: none;
   margin: 0px;
   border: none;
 }
 
 .addon[status="installed"], .addon[status="installing"] {
   background-color: #FCFCFC;
@@ -393,17 +389,17 @@
 .addon[status="uninstalled"][selected] {
   background-color: transparent;
 }
 
 
 
 /*** search view ***/
 
-#search-view > .list-container > .search-filter {
+.search-filter {
   padding: 20px;
   -moz-box-align: center;
   background-color: #FFF;
   font-size: 120%;
 }
 
 
 /*** detail view ***/
--- a/toolkit/themes/winstripe/mozapps/extensions/extensions.css
+++ b/toolkit/themes/winstripe/mozapps/extensions/extensions.css
@@ -215,20 +215,16 @@
 
 .empty-list-notice > button {
   margin: 20px;
 }
 
 
 /*** list ***/
 
-.list-container {
-  overflow: auto;
-}
-
 .list {
   -moz-appearance: none;
   margin: 0px;
   border: none;
 }
 
 .addon[status="installed"], .addon[status="installing"] {
   background-color: #FCFCFC;
@@ -393,17 +389,17 @@
 .addon[status="uninstalled"][selected] {
   background-color: transparent;
 }
 
 
 
 /*** search view ***/
 
-#search-view > .list-container > .search-filter {
+.search-filter {
   padding: 20px;
   -moz-box-align: center;
   background-color: #FFF;
   font-size: 120%;
 }
 
 
 /*** detail view ***/