Bug 1307773 - Give the Identity Dialog the height of the Account Manager. r=aceman a=jorgk
authorRichard Marti <richard.marti@gmail.com>
Sun, 16 Oct 2016 15:42:42 +0200
changeset 27521 91c110a38bf4dade626da353f98243156c396fdd
parent 27520 b6cebf7cba5ecc787639ef19208f5da812f2fa76
child 27522 8f10f52f195829c856757ebb094fe9fbabe639eb
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersaceman, jorgk
bugs1307773
Bug 1307773 - Give the Identity Dialog the height of the Account Manager. r=aceman a=jorgk
mailnews/base/prefs/content/am-identity-edit.js
mailnews/base/prefs/content/am-identity-edit.xul
--- a/mailnews/base/prefs/content/am-identity-edit.js
+++ b/mailnews/base/prefs/content/am-identity-edit.js
@@ -10,24 +10,25 @@ var gIdentity = null;  // the identity w
 var gAccount = null;   // the account the identity is (or will be) associated with
 
 function onLoadIdentityProperties()
 {
   // extract the account
   gIdentity = window.arguments[0].identity;
   gAccount = window.arguments[0].account;
 
-  // Make the dialog the same width as the main Account manager page
-  // so that the identity/copies & folders are the same width as
-  // the user set them by resizing the AM dialog.
+  // Make the dialog the same height and 90% of the width of the main Account
+  // manager page when the Account manager is not maximized.
   let accountDialog = Services.wm.getMostRecentWindow("mailnews:accountmanager")
                               .document;
-  if (accountDialog.documentElement.getAttribute("sizemode") == "normal") {
-    document.getElementById("identityTabsPanels").style.width =
-      accountDialog.getElementById("contentFrame").clientWidth + "px";
+  if (accountDialog.documentElement.getAttribute("sizemode") != "maximized") {
+    document.getElementById("identityDialog").style.width =
+      accountDialog.getElementById("accountManager").clientWidth * 0.9 + "px";
+    document.getElementById("identityDialog").style.height =
+      accountDialog.getElementById("accountManager").clientHeight + "px";
   }
 
   loadSMTPServerList();
 
   initIdentityValues(gIdentity);
   initCopiesAndFolder(gIdentity);
   initCompositionAndAddressing(gIdentity);
 }
@@ -67,24 +68,24 @@ function initIdentityValues(identity)
   }
 
   setupSignatureItems();
 }
 
 function initCopiesAndFolder(identity)
 {
   // if we are editing an existing identity, use it...otherwise copy our values from the default identity
-  var copiesAndFoldersIdentity = identity ? identity : gAccount.defaultIdentity; 
+  var copiesAndFoldersIdentity = identity ? identity : gAccount.defaultIdentity;
 
   document.getElementById('identity.fccFolder').value = copiesAndFoldersIdentity.fccFolder;
   document.getElementById('identity.draftFolder').value = copiesAndFoldersIdentity.draftFolder;
   document.getElementById('identity.archiveFolder').value = copiesAndFoldersIdentity.archiveFolder;
   document.getElementById('identity.stationeryFolder').value = copiesAndFoldersIdentity.stationeryFolder;
 
-  document.getElementById('identity.fccFolderPickerMode').value = copiesAndFoldersIdentity.fccFolderPickerMode ? copiesAndFoldersIdentity.fccFolderPickerMode : 0;  
+  document.getElementById('identity.fccFolderPickerMode').value = copiesAndFoldersIdentity.fccFolderPickerMode ? copiesAndFoldersIdentity.fccFolderPickerMode : 0;
   document.getElementById('identity.draftsFolderPickerMode').value = copiesAndFoldersIdentity.draftsFolderPickerMode ? copiesAndFoldersIdentity.draftsFolderPickerMode : 0;
   document.getElementById('identity.archivesFolderPickerMode').value = copiesAndFoldersIdentity.archivesFolderPickerMode ? copiesAndFoldersIdentity.archivesFolderPickerMode : 0;
   document.getElementById('identity.tmplFolderPickerMode').value = copiesAndFoldersIdentity.tmplFolderPickerMode ? copiesAndFoldersIdentity.tmplFolderPickerMode : 0;
 
   document.getElementById('identity.doCc').checked = copiesAndFoldersIdentity.doCc;
   document.getElementById('identity.doCcList').value = copiesAndFoldersIdentity.doCcList;
   document.getElementById('identity.doBcc').checked = copiesAndFoldersIdentity.doBcc;
   document.getElementById('identity.doBccList').value = copiesAndFoldersIdentity.doBccList;
@@ -133,17 +134,17 @@ function onOk()
     gIdentity.copy(gAccount.defaultIdentity);
 
     // assume the identity is valid by default?
     gIdentity.valid = true;
 
     // add the identity to the account
     gAccount.addIdentity(gIdentity);
 
-    // now fall through to saveFields which will save our new values        
+    // now fall through to saveFields which will save our new values
   }
 
   // if we are modifying an existing identity, save the fields
   saveIdentitySettings(gIdentity);
   saveCopiesAndFolderSettings(gIdentity);
   saveAddressingAndCompositionSettings(gIdentity);
 
   window.arguments[0].result = true;
@@ -320,17 +321,17 @@ function setupSignatureItems()
   if (checked && !getAccountValueIsLocked(signature))
     signature.removeAttribute("disabled");
   else
     signature.setAttribute("disabled", "true");
 
   if (checked && !getAccountValueIsLocked(browse))
     browse.removeAttribute("disabled");
   else
-    browse.setAttribute("disabled", "true"); 
+    browse.setAttribute("disabled", "true");
 }
 
 function editVCardCallback(escapedVCardStr)
 {
   var escapedVCard = document.getElementById("identity.escapedVCard");
   escapedVCard.value = escapedVCardStr;
 }
 
--- a/mailnews/base/prefs/content/am-identity-edit.xul
+++ b/mailnews/base/prefs/content/am-identity-edit.xul
@@ -11,17 +11,18 @@
 
 <!DOCTYPE dialog [
 <!ENTITY % identityEditDTD SYSTEM "chrome://messenger/locale/am-identity-edit.dtd" >
 %identityEditDTD;
 <!ENTITY % identityDTD SYSTEM "chrome://messenger/locale/am-main.dtd" >
 %identityDTD;
 ]>
 
-<dialog title="&identityTitle.label;"
+<dialog id="identityDialog"
+        title="&identityTitle.label;"
         xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
         onload="onLoadIdentityProperties();"
         ondialogaccept="return onOk();"
         style="&identityDialog.style;">
 
   <stringbundle id="bundle_prefs"
                 src="chrome://messenger/locale/prefs.properties"/>
@@ -41,17 +42,17 @@
   <tabbox flex="1" style="overflow: auto;">
     <tabs id="identitySettings">
       <tab label="&settingsTab.label;"/>
       <tab label="&copiesFoldersTab.label;"/>
       <tab label="&addressingTab.label;"/>
     </tabs>
 
     <tabpanels id="identityTabsPanels" flex="1">
-      <!-- Identity Settings Tab --> 
+      <!-- Identity Settings Tab -->
       <vbox flex="1" name="settings">
         <grid>
           <columns>
             <column/>
             <column flex="1"/>
           </columns>
           <rows>
             <row align="center">
@@ -125,11 +126,11 @@
       </vbox>
 
       <!-- Copies & Folders Tab -->
       <vbox flex="1" name="copiesAndFolders" id="copiesAndFolders"/>
 
       <!-- Composition & Addressing Tab -->
       <vbox flex="1" name="composeAddressing" id="compositionAndAddressing"/>
 
-    </tabpanels> 
+    </tabpanels>
   </tabbox>
 </dialog>