Bug 1498904 - Fix issues after bug 1483335 (about:preferences to about:addons links). r=aceman
authorRichard Marti <richard.marti@gmail.com>
Sun, 14 Oct 2018 11:18:13 +0200
changeset 33426 f77ce17097fa70f4a394f4ac1abc99ffdc116823
parent 33425 66f690f4e070f2809fa2ee855ddf70aef1a846b1
child 33427 d56379e7d07557b787107074102eaedd841d9280
push id387
push userclokep@gmail.com
push dateMon, 10 Dec 2018 21:30:47 +0000
reviewersaceman
bugs1498904, 1483335
Bug 1498904 - Fix issues after bug 1483335 (about:preferences to about:addons links). r=aceman - Give the whole extension category box a background color. - Set the correct prefs icon. - Hide the Help button. - Add Add-ons button to the prefs.
mail/base/content/mailWindow.js
mail/base/jar.mn
mail/components/preferences/aboutPreferences.xml
mail/locales/en-US/chrome/messenger/preferences/preferences.dtd
mail/themes/linux/mail/preferences/aboutPreferences.css
mail/themes/osx/mail/preferences/aboutPreferences.css
mail/themes/shared/mail/extensionsOverlay.css
mail/themes/shared/mail/incontentprefs/aboutPreferences.css
mail/themes/windows/mail/preferences/aboutPreferences.css
--- a/mail/base/content/mailWindow.js
+++ b/mail/base/content/mailWindow.js
@@ -737,16 +737,21 @@ function MailSetCharacterSet(aEvent) {
  */
 function switchToTabHavingURI(aURI, aOpenNew, aOpenParams) {
   let tabmail = document.getElementById("tabmail");
   let matchingIndex = -1;
   if (tabmail) {
     let openURI = makeURI(aURI);
     let tabInfo = tabmail.tabInfo;
 
+    // about:preferences should be opened through openPreferencesTab().
+    if (openURI = "about:preferences") {
+      openPreferencesTab();
+      return;
+    }
     // Check if we already have the same URL open in a content tab.
     for (let tabIndex = 0; tabIndex < tabInfo.length; tabIndex++) {
       if (tabInfo[tabIndex].mode.name == "contentTab") {
         let browserFunc = tabInfo[tabIndex].mode.getBrowser ||
                           tabInfo[tabIndex].mode.tabType.getBrowser;
         if (browserFunc) {
           let browser = browserFunc.call(tabInfo[tabIndex].mode.tabType, tabInfo[tabIndex]);
           if (browser.currentURI.equals(openURI)) {
--- a/mail/base/jar.mn
+++ b/mail/base/jar.mn
@@ -1,13 +1,14 @@
 #filter substitution
 
 messenger.jar:
 % content messagebody %content/messagebody/ contentaccessible=yes
 % content messenger %content/messenger/
+% override chrome://browser/skin/preferences/in-content/general.svg chrome://mozapps/skin/extensions/utilities.svg
 % override chrome://global/content/nsDragAndDrop.js chrome://messenger/content/nsDragAndDrop.js
 % override chrome://messagebody/skin/messageBody.css chrome://messenger/skin/messageBody.css
 #ifndef MOZILLA_OFFICIAL
 % override chrome://browser/content/browser-development-helpers.js chrome://messenger/content/browser-development-helpers.js
   content/messenger/browser-development-helpers.js (../../common/src/browser-development-helpers.js)
 #endif
     content/messenger/mailWindow.js                 (content/mailWindow.js)
     content/messenger/messageDisplay.js             (content/messageDisplay.js)
--- a/mail/components/preferences/aboutPreferences.xml
+++ b/mail/components/preferences/aboutPreferences.xml
@@ -22,16 +22,27 @@
              closebuttonlabel="&preferencesCloseButton.label;"
              closebuttonaccesskey="&preferencesCloseButton.accesskey;"
              role="dialog">
       <xul:stack flex="1">
         <xul:hbox id="prefBox" flex="1">
           <xul:vbox id="category-box">
             <xul:radiogroup anonid="selector" orient="vertical" class="paneSelector chromeclass-toolbar"
                             role="listbox"/> <!-- Expose to accessibility APIs as a listbox -->
+            <xul:spacer flex="1"/>
+            <xul:hbox class="sidebar-footer-button"
+                      pack="center"
+                      onclick="window.docShell.rootTreeItem.domWindow.openAddonsMgr();">
+            <xul:label id="addonsButton" class="text-link">
+              <xul:hbox align="center">
+                <xul:image class="sidebar-footer-icon addons-icon"/>
+                <xul:label class="sidebar-footer-label" flex="1">&addonsButton.label;</xul:label>
+              </xul:hbox>
+            </xul:label>
+          </xul:hbox>
           </xul:vbox>
           <xul:hbox id="preferencesContainer" flex="1">
             <xul:hbox class="paneDeckContainer" flex="1">
               <xul:deck anonid="paneDeck" flex="1">
                 <children includes="prefpane"/>
               </xul:deck>
             </xul:hbox>
           </xul:hbox>
--- a/mail/locales/en-US/chrome/messenger/preferences/preferences.dtd
+++ b/mail/locales/en-US/chrome/messenger/preferences/preferences.dtd
@@ -18,10 +18,12 @@
 <!ENTITY paneChat.title           "Chat">
 <!ENTITY paneAttachments.title    "Attachments">
 <!ENTITY panePrivacy.title        "Privacy">
 <!ENTITY paneSecurity.title       "Security">
 <!ENTITY paneLightning.title      "Calendar">
 <!ENTITY paneAdvanced.title       "Advanced">
 <!ENTITY paneAccount.title        "Accounts">
 
+<!ENTITY addonsButton.label       "Extensions &amp; Themes">
+
 <!ENTITY okButton.title           "OK">
 <!ENTITY okButton.accesskey       "O">
--- a/mail/themes/linux/mail/preferences/aboutPreferences.css
+++ b/mail/themes/linux/mail/preferences/aboutPreferences.css
@@ -37,16 +37,20 @@ menulist.actionsMenu > .menulist-dropmar
 }
 
 textbox[type="number"] {
   -moz-appearance: none;
   border: 1px solid var(--in-content-box-border-color);
   background-color: var(--in-content-box-background);
 }
 
+.sidebar-footer-label {
+  font-size: 1em;
+}
+
 /**
  * Dialog
  */
 
 #dialogTitle {
   font-size: 1.05em;
 }
 
--- a/mail/themes/osx/mail/preferences/aboutPreferences.css
+++ b/mail/themes/osx/mail/preferences/aboutPreferences.css
@@ -81,16 +81,20 @@ radio[pane][selected] {
 }
 
 .actionsMenu > .menulist-label-box > .menulist-icon {
   margin-top: 2px;
   margin-inline-start: 2px;
   margin-inline-end: 8px !important;
 }
 
+.sidebar-footer-label {
+  font-size: 1.224em;
+}
+
 /**
  * Dialog
  */
 
 #dialogTitle {
   font-size: 1.1em;
 }
 
--- a/mail/themes/shared/mail/extensionsOverlay.css
+++ b/mail/themes/shared/mail/extensionsOverlay.css
@@ -1,14 +1,14 @@
 /* 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/. */
 
 #nav-header,
-#categories {
+#category-box {
   background-color: #ebebef;
 }
 
 .nav-button {
   list-style-image: url(chrome://messenger/skin/icons/navigation.svg);
   margin-top: 15px;
   margin-bottom: 10px;
   border-color: transparent;
@@ -19,8 +19,16 @@
 #back-btn:-moz-locale-dir(rtl),
 #forward-btn:-moz-locale-dir(ltr) {
   transform: scaleX(-1);
 }
 
 #categories {
   padding-top: 0;
 }
+
+#preferencesButton {
+ margin-bottom: 36px;
+}
+
+.sidebar-footer-button.help-button {
+  display: none;
+}
--- a/mail/themes/shared/mail/incontentprefs/aboutPreferences.css
+++ b/mail/themes/shared/mail/incontentprefs/aboutPreferences.css
@@ -56,17 +56,16 @@ tabpanel > hbox > description {
 
 .paneSelector {
   -moz-appearance: none;
   background-color: transparent;
   background-image: none;
   border-bottom: none;
   padding: 54px 0 0;
   margin: 0;
-  min-height: 100vh;
 }
 
 radio[pane] {
   -moz-box-orient: horizontal;
   -moz-binding: url("chrome://global/content/bindings/radio.xml#radio") !important;
   -moz-appearance: none;
   width: 240px;
   color: var(--in-content-category-text);
--- a/mail/themes/windows/mail/preferences/aboutPreferences.css
+++ b/mail/themes/windows/mail/preferences/aboutPreferences.css
@@ -16,15 +16,19 @@ radio[pane] > .radio-label-box {
 .actionsMenu > .menulist-label-box > .menulist-icon {
   margin-inline-end: 9px;
 }
 
 caption {
   background-color: transparent;
 }
 
+.sidebar-footer-label {
+  font-size: 1.125em;
+}
+
 /**
  * Dialog
  */
 
 #dialogTitle {
   font-size: 1.05em;
 }