Bug 1435688 - Part 1 - Replace "listitem-iconic" with "richlistitem" in the Windows handler application picker dialog. r=bgrins draft
authorPaolo Amadini <paolo.mozmail@amadzone.org>
Sat, 23 Jun 2018 19:21:31 +0100
changeset 809894 aa7dbbd398e1118cf144fccd3c9f4f29ad3861ed
parent 809377 27e90ec610a4c8f6b2a73d79cb1a4df38e822e6a
child 809895 d103bae10272030d6a1f78d8a679ab69f72ee5c6
push id113840
push userpaolo.mozmail@amadzone.org
push dateSat, 23 Jun 2018 20:25:01 +0000
reviewersbgrins
bugs1435688
milestone62.0a1
Bug 1435688 - Part 1 - Replace "listitem-iconic" with "richlistitem" in the Windows handler application picker dialog. r=bgrins MozReview-Commit-ID: AFbtPsMC0bG
toolkit/components/apppicker/content/appPicker.js
toolkit/components/apppicker/content/appPicker.xul
toolkit/themes/shared/appPicker.css
--- a/toolkit/components/apppicker/content/appPicker.js
+++ b/toolkit/components/apppicker/content/appPicker.js
@@ -72,23 +72,28 @@ AppPicker.prototype =
           var file = fileList.queryElementAt(idx, nsILocalHandlerApp);
           try {
               if (!file.executable || !file.executable.isFile())
                 continue;
           } catch (err) {
             continue;
           }
 
-          var item = document.createElement("listitem");
-          item.className = "listitem-iconic";
+          var item = document.createElement("richlistitem");
           item.handlerApp = file;
-          item.setAttribute("label", this.getFileDisplayName(file.executable));
-          item.setAttribute("image", this.getFileIconURL(file.executable));
           list.appendChild(item);
 
+          var image = document.createElement("image");
+          image.setAttribute("src", this.getFileIconURL(file.executable));
+          item.appendChild(image);
+
+          var label = document.createElement("label");
+          label.setAttribute("value", this.getFileDisplayName(file.executable));
+          item.appendChild(label);
+
           primaryCount++;
         }
 
         if ( primaryCount == 0 ) {
           // display a message saying nothing is configured
           document.getElementById("app-picker-notfound").removeAttribute("hidden");
         }
     },
--- a/toolkit/components/apppicker/content/appPicker.xul
+++ b/toolkit/components/apppicker/content/appPicker.xul
@@ -28,13 +28,13 @@
       <vbox flex="1">
         <label id="content-description" crop="center" value=""/>
         <label id="suggested-filename" crop="center" value=""/>
       </vbox>
     </hbox>
 
     <label id="sendto-message" value="&SendMsg.label;" control="app-picker-listbox"/>
 
-    <listbox id="app-picker-listbox" rows="5"
-             ondblclick="g_dialog.appDoubleClick();"/>
+    <richlistbox id="app-picker-listbox"
+                 ondblclick="g_dialog.appDoubleClick();"/>
 
     <label id="app-picker-notfound" value="&NoAppFound.label;" hidden="true"/>
   </dialog>
--- a/toolkit/themes/shared/appPicker.css
+++ b/toolkit/themes/shared/appPicker.css
@@ -6,18 +6,28 @@
 #app-picker {
   width: 320px;
 }
 
 #content-description {
   font-weight: bold;
 }
 
+#app-picker-listbox {
+  height: 212px;
+}
+
+#app-picker-listbox > richlistitem {
+  -moz-box-align: center;
+}
+
 #content-icon,
-.listcell-icon {
+#app-picker-listbox > richlistitem > image {
   margin: 5px;
   width: 32px;
   height: 32px;
 }
 
-.listcell-label {
+#app-picker-listbox > richlistitem > label {
+  margin: 0px;
   padding: 5px;
+  white-space: nowrap;
 }