Bug 944947 - automatically hyphenate labels for items in Australis' menupanel, r=MattN

--HG--
extra : rebase_source : 3c621f7203eaec41d545c6da884f2b6856af94a7
This commit is contained in:
Gijs Kruitbosch 2014-01-17 19:11:57 +01:00
parent 0bd98e93a5
commit 38de1add5a
2 changed files with 25 additions and 0 deletions

View File

@ -207,6 +207,8 @@ const PanelUI = {
return this._readyPromise;
}
this._readyPromise = Task.spawn(function() {
this.contents.setAttributeNS("http://www.w3.org/XML/1998/namespace", "lang",
getLocale());
if (!this._scrollWidth) {
// In order to properly center the contents of the panel, while ensuring
// that we have enough space on either side to show a scrollbar, we have to
@ -418,3 +420,25 @@ const PanelUI = {
this.removeEventListener("command", PanelUI.onCommandHandler);
}
};
/**
* Gets the currently selected locale for display.
* @return the selected locale or "en-US" if none is selected
*/
function getLocale() {
try {
let locale = Services.prefs.getComplexValue(PREF_SELECTED_LOCALE,
Ci.nsIPrefLocalizedString);
if (locale)
return locale;
}
catch (e) { }
try {
return Services.prefs.getCharPref(PREF_SELECTED_LOCALE);
}
catch (e) { }
return "en-US";
}

View File

@ -79,6 +79,7 @@ toolbaritem[cui-areatype="menu-panel"][sdkstylewidget="true"]:not(.panel-wide-it
font-size: @panelTextSize@;
margin: 2px 0 0;
text-align: center;
-moz-hyphens: auto;
}
#wrapper-edit-controls:-moz-any([place="palette"],[place="panel"]) > #edit-controls,