Bug 787640 - Account wizard and account settings window dimension too small, input fields cut off/cropped, port input hidden. r=florian, ui-r=bwinton
authorRichard Marti <richard.marti@gmail.com>
Tue, 18 Sep 2012 19:13:19 +0200
changeset 11118 432feab3693cbf72f86de47aae78ec49840ee646
parent 11117 089215e2d64ff8a34ffaafe9ad7b5d2a4415b48f
child 11119 49a9b1d1e8beb9998ae5722713fbde9b7e9134bc
push id8343
push userryanvm@gmail.com
push dateMon, 24 Sep 2012 22:09:10 +0000
treeherdercomm-central@dd7842775a4a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersflorian, bwinton
bugs787640
Bug 787640 - Account wizard and account settings window dimension too small, input fields cut off/cropped, port input hidden. r=florian, ui-r=bwinton
mail/components/im/content/am-im.js
mail/components/im/content/imAccountWizard.js
mail/components/im/content/imAccountWizard.xul
mail/components/im/themes/imAccountWizard.css
--- a/mail/components/im/content/am-im.js
+++ b/mail/components/im/content/am-im.js
@@ -74,18 +74,17 @@ var account = {
     textbox.setAttribute("wsm_persist", "true");
     textbox.setAttribute("genericattr", "true");
 
     box.appendChild(textbox);
     return box;
   },
 
   createMenulist: function account_createMenulist(aList, aLabel, aName) {
-    var box = document.createElement("hbox");
-    box.setAttribute("align", "baseline");
+    var box = document.createElement("vbox");
 
     var label = document.createElement("label");
     label.setAttribute("value", aLabel);
     label.setAttribute("control", aName);
     box.appendChild(label);
 
     aList.QueryInterface(Ci.nsISimpleEnumerator);
     var menulist = document.createElement("menulist");
--- a/mail/components/im/content/imAccountWizard.js
+++ b/mail/components/im/content/imAccountWizard.js
@@ -167,88 +167,87 @@ var accountWizard = {
 
     this.populateProtoSpecificBox();
 
     let alias = document.getElementById("alias");
     alias.focus();
   },
 
   createTextbox: function aw_createTextbox(aType, aValue, aLabel, aName) {
-    var box = document.createElement("hbox");
-    box.setAttribute("align", "baseline");
-    box.setAttribute("equalsize", "always");
+    var row = document.createElement("row");
+    row.setAttribute("align", "center");
 
     var label = document.createElement("label");
-    label.setAttribute("value", aLabel);
+    label.textContent = aLabel;
     label.setAttribute("control", aName);
-    box.appendChild(label);
+    row.appendChild(label);
 
     var textbox = document.createElement("textbox");
     if (aType)
       textbox.setAttribute("type", aType);
     textbox.setAttribute("value", aValue);
     textbox.setAttribute("id", aName);
     textbox.setAttribute("flex", "1");
 
-    box.appendChild(textbox);
-    return box;
+    row.appendChild(textbox);
+    return row;
   },
 
   createMenulist: function aw_createMenulist(aList, aLabel, aName) {
-    var box = document.createElement("hbox");
-    box.setAttribute("align", "baseline");
+    var vbox = document.createElement("vbox");
+    vbox.setAttribute("flex", "1");
 
     var label = document.createElement("label");
     label.setAttribute("value", aLabel);
     label.setAttribute("control", aName);
-    box.appendChild(label);
+    vbox.appendChild(label);
 
     aList.QueryInterface(Ci.nsISimpleEnumerator);
     var menulist = document.createElement("menulist");
     menulist.setAttribute("id", aName);
     var popup = menulist.appendChild(document.createElement("menupopup"));
     while (aList.hasMoreElements()) {
       let elt = aList.getNext();
       let item = document.createElement("menuitem");
       item.setAttribute("label", elt.name);
       item.setAttribute("value", elt.value);
       popup.appendChild(item);
     }
-    box.appendChild(menulist);
-    return box;
+    vbox.appendChild(menulist);
+    return vbox;
   },
 
   populateProtoSpecificBox: function aw_populate() {
     var id = this.proto.id;
-    var box = document.getElementById("protoSpecific");
+    var rows = document.getElementById("protoSpecific");
     var child;
-    while ((child = box.firstChild))
-      box.removeChild(child);
+    while ((child = rows.firstChild))
+      rows.removeChild(child);
     var visible = false;
     for (let opt in this.getProtoOptions()) {
       var text = opt.label;
       var name = id + "-" + opt.name;
       switch (opt.type) {
       case opt.typeBool:
         var chk = document.createElement("checkbox");
         chk.setAttribute("label", text);
         chk.setAttribute("id", name);
         if (opt.getBool())
           chk.setAttribute("checked", "true");
-        box.appendChild(chk);
+        rows.appendChild(chk);
         break;
       case opt.typeInt:
-        box.appendChild(this.createTextbox("number", opt.getInt(),
+        rows.appendChild(this.createTextbox("number", opt.getInt(),
                                            text, name));
         break;
       case opt.typeString:
-        box.appendChild(this.createTextbox(null, opt.getString(), text, name));
+        rows.appendChild(this.createTextbox(null, opt.getString(), text, name));
         break;
       case opt.typeList:
-        box.appendChild(this.createMenulist(opt.getList(), text, name));
+        rows.appendChild(this.createMenulist(opt.getList(), text, name));
         document.getElementById(name).value = opt.getListDefault();
         break;
       default:
         throw "unknown preference type " + opt.type;
       }
       visible = true;
     }
     document.getElementById("protoSpecificGroupbox").hidden = !visible;
--- a/mail/components/im/content/imAccountWizard.xul
+++ b/mail/components/im/content/imAccountWizard.xul
@@ -79,17 +79,23 @@
 
     <checkbox id="newMailNotification"
               label="&accountAdvanced.newMailNotification.label;" hidden="true"/>
 
     <groupbox id="protoSpecificGroupbox" class="collapsable" closed="true"
               onkeypress="accountWizard.onGroupboxKeypress(event)">
       <caption id="protoSpecificCaption"
                onclick="accountWizard.toggleGroupbox('protoSpecificGroupbox')"/>
-      <vbox id="protoSpecific" flex="1"/>
+      <grid flex="1">
+        <columns>
+          <column id="label-column" flex="1"/>
+          <column id="value-column" flex="1"/>
+        </columns>
+        <rows id="protoSpecific"/>
+      </grid>
     </groupbox>
   </wizardpage>
 
   <wizardpage id="accountsummary" pageid="accountsummary"
               label="&accountSummaryTitle.label;"
               onpageshow="accountWizard.showSummary();">
     <description>&accountSummaryInfo.label;</description>
     <separator/>
--- a/mail/components/im/themes/imAccountWizard.css
+++ b/mail/components/im/themes/imAccountWizard.css
@@ -1,12 +1,16 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
+%ifdef XP_WIN
+@namespace html url("http://www.w3.org/1999/xhtml");
+%endif
+
 #accountprotocol,
 #accountsummary {
   overflow: visible;
 }
 
 #summarygrid {
   overflow: auto;
 }
@@ -58,8 +62,18 @@
   background-image: url("chrome://global/skin/tree/twisty-open.png");
 }
 
 
 .collapsable[closed="true"] .caption-icon {
   background-image: url("chrome://global/skin/tree/twisty-clsd.png");
 }
 %endif
+
+#value-column {
+  min-width: 15em;
+}
+
+%ifdef XP_WIN
+textbox html|*.textbox-input:-moz-placeholder {
+  font-style: normal;
+}
+%endif