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

This commit is contained in:
Gijs Kruitbosch 2014-01-17 19:11:57 +01:00
parent be20880b61
commit 4ba4010156
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
@ -412,3 +414,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

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