зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1344307 - Clean up lightweight theme footer handling. r=jaws
MozReview-Commit-ID: BIUszE69HhH --HG-- extra : rebase_source : 92da21798e8e27d7f69a5d3245c97c9ac99f7af8
This commit is contained in:
Родитель
88d3231652
Коммит
493fea90a4
|
@ -451,11 +451,11 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
|
|||
}
|
||||
%endif
|
||||
|
||||
#browser-bottombox[lwthemefooter="true"] {
|
||||
:root[lwthemefooter=true] #browser-bottombox:-moz-lwtheme {
|
||||
background-repeat: no-repeat;
|
||||
background-position: bottom left;
|
||||
background-color: var(--lwt-accent-color);
|
||||
background-image: var(--lwt-header-image);
|
||||
background-image: var(--lwt-footer-image);
|
||||
}
|
||||
|
||||
.menuitem-iconic-tooltip {
|
||||
|
|
|
@ -52,7 +52,6 @@
|
|||
#endif
|
||||
titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
|
||||
lightweightthemes="true"
|
||||
lightweightthemesfooter="browser-bottombox"
|
||||
windowtype="navigator:browser"
|
||||
macanimationtype="document"
|
||||
screenX="4" screenY="4"
|
||||
|
|
|
@ -17,7 +17,6 @@ this.LightweightThemeConsumer =
|
|||
function LightweightThemeConsumer(aDocument) {
|
||||
this._doc = aDocument;
|
||||
this._win = aDocument.defaultView;
|
||||
this._footerId = aDocument.documentElement.getAttribute("lightweightthemesfooter");
|
||||
|
||||
let screen = this._win.screen;
|
||||
this._lastScreenWidth = screen.width;
|
||||
|
@ -123,15 +122,12 @@ LightweightThemeConsumer.prototype = {
|
|||
|
||||
this._active = active;
|
||||
|
||||
_setImage(root, active, aData.headerURL, "--lwt-header-image");
|
||||
if (this._footerId) {
|
||||
let footer = this._doc.getElementById(this._footerId);
|
||||
_setImage(footer, active, aData.footerURL, "--lwt-footer-image");
|
||||
if (active && aData.footerURL)
|
||||
footer.setAttribute("lwthemefooter", "true");
|
||||
else
|
||||
footer.removeAttribute("lwthemefooter");
|
||||
}
|
||||
_setImage(root, active, "--lwt-header-image", aData.headerURL);
|
||||
_setImage(root, active, "--lwt-footer-image", aData.footerURL);
|
||||
if (active && aData.footerURL)
|
||||
root.setAttribute("lwthemefooter", "true");
|
||||
else
|
||||
root.removeAttribute("lwthemefooter");
|
||||
|
||||
// On OS X, we extend the lightweight theme into the titlebar, which means setting
|
||||
// the chromemargin attribute. Some XUL applications already draw in the titlebar,
|
||||
|
@ -159,11 +155,11 @@ LightweightThemeConsumer.prototype = {
|
|||
}
|
||||
}
|
||||
|
||||
function _setImage(aElement, aActive, aURL, aVariableName) {
|
||||
function _setImage(aRoot, aActive, aVariableName, aURL) {
|
||||
if (aActive && aURL) {
|
||||
aElement.style.setProperty(aVariableName, `url("${aURL.replace(/"/g, '\\"')}")`);
|
||||
aRoot.style.setProperty(aVariableName, `url("${aURL.replace(/"/g, '\\"')}")`);
|
||||
} else {
|
||||
aElement.style.removeProperty(aVariableName);
|
||||
aRoot.style.removeProperty(aVariableName);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -155,7 +155,6 @@ toolbar[mode="text"] .toolbarbutton-text {
|
|||
/* ::::: miscellaneous formatting ::::: */
|
||||
|
||||
:root:-moz-lwtheme,
|
||||
[lwthemefooter="true"],
|
||||
statusbarpanel:-moz-lwtheme {
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
|
|
@ -115,8 +115,7 @@ statusbarpanel {
|
|||
|
||||
/* ::::: miscellaneous formatting ::::: */
|
||||
|
||||
:root:-moz-lwtheme,
|
||||
[lwthemefooter="true"] {
|
||||
:root:-moz-lwtheme {
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -156,8 +156,7 @@ toolbar[mode="text"] .toolbarbutton-text {
|
|||
|
||||
/* ::::: miscellaneous formatting ::::: */
|
||||
|
||||
:root:-moz-lwtheme,
|
||||
[lwthemefooter="true"] {
|
||||
:root:-moz-lwtheme {
|
||||
-moz-appearance: none;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче