Bug 1469696 - Part 6: Update warning message, limit width r=flod,jaws
authorMark Striemer <mstriemer@mozilla.com>
Tue, 02 Oct 2018 17:57:33 +0000
changeset 487770 5b0ef00bdd7c5c98aa8eea2ffcd077fe23d10d8c
parent 487769 54abaf608a606310adfebfa816051aa55bf6475a
child 487771 f54d088190672270c1487359a13a9ec9a9940e79
push id246
push userfmarier@mozilla.com
push dateSat, 13 Oct 2018 00:15:40 +0000
reviewersflod, jaws
bugs1469696
milestone64.0a1
Bug 1469696 - Part 6: Update warning message, limit width r=flod,jaws Differential Revision: https://phabricator.services.mozilla.com/D7216
browser/components/preferences/browserLanguages.js
browser/components/preferences/browserLanguages.xul
browser/locales/en-US/browser/preferences/languages.ftl
browser/themes/shared/incontentprefs/preferences.inc.css
toolkit/themes/shared/in-content/common.inc.css
--- a/browser/components/preferences/browserLanguages.js
+++ b/browser/components/preferences/browserLanguages.js
@@ -151,16 +151,17 @@ class SortedItemSelectList {
     button.addEventListener("command", () => {
       if (!menulist.selectedItem) return;
 
       let [item] = this.items.splice(menulist.selectedIndex, 1);
       menulist.selectedItem.remove();
       menulist.setAttribute("label", menulist.getAttribute("placeholder"));
       button.disabled = true;
       menulist.disabled = menulist.itemCount == 0;
+      menulist.selectedIndex = -1;
 
       onSelect(item);
     });
   }
 
   setItems(items) {
     this.items = items.sort(this.compareFn);
     this.populate();
--- a/browser/components/preferences/browserLanguages.xul
+++ b/browser/components/preferences/browserLanguages.xul
@@ -57,15 +57,13 @@
                   data-l10n-id="languages-customize-add"
                   disabled="true"/>
         </row>
       </rows>
     </grid>
     <separator class="warning-message-separator"/>
     <hbox id="warning-message" class="message-bar message-bar-warning" hidden="true">
       <image class="message-bar-icon"/>
-      <hbox align="center" flex="1">
-        <description class="message-bar-description" data-l10n-id="browser-languages-error"/>
-      </hbox>
+      <description class="message-bar-description" data-l10n-id="browser-languages-error"/>
     </hbox>
     <separator class="warning-message-separator"/>
   </vbox>
 </dialog>
--- a/browser/locales/en-US/browser/preferences/languages.ftl
+++ b/browser/locales/en-US/browser/preferences/languages.ftl
@@ -65,10 +65,9 @@ browser-languages-downloading =
 
 browser-languages-select-language =
     .label = Select a language to add…
     .placeholder = Select a language to add…
 
 browser-languages-installed-label = Installed languages
 browser-languages-available-label = Available languages
 
-browser-languages-error =
-    .value = An error occurred.
+browser-languages-error = { -brand-short-name } can’t update your languages right now. Check that you are connected to the internet or try again.
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -961,16 +961,20 @@ menulist[indicator=true] > menupopup men
 }
 
 #availableLanguages,
 #availableLocales {
   margin: 0;
   margin-inline-end: 4px;
 }
 
+#warning-message > .message-bar-description {
+  width: 32em;
+}
+
 .add-web-language,
 .add-browser-language {
   margin: 0;
   margin-inline-start: 4px;
 }
 
 .action-button {
   margin-inline-end: 0;
--- a/toolkit/themes/shared/in-content/common.inc.css
+++ b/toolkit/themes/shared/in-content/common.inc.css
@@ -793,17 +793,21 @@ xul|treechildren::-moz-tree-image(select
 }
 
 /* Message bars */
 .message-bar {
   background-color: var(--grey-20);
   border-radius: 4px;
   color: var(--grey-90);
   min-height: 32px;
-  padding: 0 4px;
+  padding: 4px;
+}
+
+.message-bar-description {
+  line-height: 1.25;
 }
 
 /* The message-bar-button styles have extra specificity to override
  * the defaults for buttons. */
 .message-bar > hbox > .message-bar-button {
   background-color: var(--grey-90-a10);
   border: none;
   border-radius: 2px;