mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Back out a4045a049e9e (bug 662324) for browser-chrome orange
This commit is contained in:
parent
a75369871d
commit
8d187947cf
@ -68,18 +68,6 @@ var gSetBackground = {
|
|||||||
if (this._screenWidth / this._screenHeight >= 1.6)
|
if (this._screenWidth / this._screenHeight >= 1.6)
|
||||||
document.getElementById("monitor").setAttribute("aspectratio", "16:10");
|
document.getElementById("monitor").setAttribute("aspectratio", "16:10");
|
||||||
|
|
||||||
#ifdef XP_WIN
|
|
||||||
// hide fill + fit options if <win7 since don't work
|
|
||||||
var version = Components.classes["@mozilla.org/system-info;1"]
|
|
||||||
.getService(Ci.nsIPropertyBag2)
|
|
||||||
.getProperty("version");
|
|
||||||
var isWindows7OrHigher = (parseFloat(version) >= 6.1);
|
|
||||||
if (!isWindows7OrHigher) {
|
|
||||||
document.getElementById("fillPosition").hidden = true;
|
|
||||||
document.getElementById("fitPosition").hidden = true;
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// make sure that the correct dimensions will be used
|
// make sure that the correct dimensions will be used
|
||||||
setTimeout(function(self) {
|
setTimeout(function(self) {
|
||||||
self.init(window.arguments[0]);
|
self.init(window.arguments[0]);
|
||||||
@ -210,39 +198,6 @@ var gSetBackground = {
|
|||||||
var x = (this._screenWidth - this._image.naturalWidth) / 2;
|
var x = (this._screenWidth - this._image.naturalWidth) / 2;
|
||||||
var y = (this._screenHeight - this._image.naturalHeight) / 2;
|
var y = (this._screenHeight - this._image.naturalHeight) / 2;
|
||||||
ctx.drawImage(this._image, x, y);
|
ctx.drawImage(this._image, x, y);
|
||||||
break;
|
|
||||||
case "FILL":
|
|
||||||
//Try maxing width first, overflow height
|
|
||||||
var widthRatio = this._screenWidth / this._image.naturalWidth;
|
|
||||||
var width = this._image.naturalWidth * widthRatio;
|
|
||||||
var height = this._image.naturalHeight * widthRatio;
|
|
||||||
if (height < this._screenHeight) {
|
|
||||||
//height less than screen, max height and overflow width
|
|
||||||
var heightRatio = this._screenHeight / this._image.naturalHeight;
|
|
||||||
width = this._image.naturalWidth * heightRatio;
|
|
||||||
height = this._image.naturalHeight * heightRatio;
|
|
||||||
}
|
|
||||||
var x = (this._screenWidth - width) / 2;
|
|
||||||
var y = (this._screenHeight - height) / 2;
|
|
||||||
ctx.drawImage(this._image, x, y, width, height);
|
|
||||||
break;
|
|
||||||
case "FIT":
|
|
||||||
//Try maxing width first, top and bottom borders
|
|
||||||
var widthRatio = this._screenWidth / this._image.naturalWidth;
|
|
||||||
var width = this._image.naturalWidth * widthRatio;
|
|
||||||
var height = this._image.naturalHeight * widthRatio;
|
|
||||||
var x = 0;
|
|
||||||
var y = (this._screenHeight - height) / 2;
|
|
||||||
if (height > this._screenHeight) {
|
|
||||||
//height overflow, maximise height, side borders
|
|
||||||
var heightRatio = this._screenHeight / this._image.naturalHeight;
|
|
||||||
width = this._image.naturalWidth * heightRatio;
|
|
||||||
height = this._image.naturalHeight * heightRatio;
|
|
||||||
x = (this._screenWidth - width) / 2;
|
|
||||||
y = 0;
|
|
||||||
}
|
|
||||||
ctx.drawImage(this._image, x, y, width, height);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -78,8 +78,6 @@
|
|||||||
<menuitem label="¢er.label;" value="CENTER"/>
|
<menuitem label="¢er.label;" value="CENTER"/>
|
||||||
<menuitem label="&tile.label;" value="TILE"/>
|
<menuitem label="&tile.label;" value="TILE"/>
|
||||||
<menuitem label="&stretch.label;" value="STRETCH"/>
|
<menuitem label="&stretch.label;" value="STRETCH"/>
|
||||||
<menuitem label="&fill.label;" value="FILL" id="fillPosition"/>
|
|
||||||
<menuitem label="&fit.label;" value="FIT" id="fitPosition"/>
|
|
||||||
</menupopup>
|
</menupopup>
|
||||||
</menulist>
|
</menulist>
|
||||||
<spacer flex="1"/>
|
<spacer flex="1"/>
|
||||||
|
@ -81,7 +81,6 @@ interface nsIShellService : nsISupports
|
|||||||
const long BACKGROUND_STRETCH = 2;
|
const long BACKGROUND_STRETCH = 2;
|
||||||
const long BACKGROUND_CENTER = 3;
|
const long BACKGROUND_CENTER = 3;
|
||||||
const long BACKGROUND_FILL = 4;
|
const long BACKGROUND_FILL = 4;
|
||||||
const long BACKGROUND_FIT = 5;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets the desktop background image using either the HTML <IMG>
|
* Sets the desktop background image using either the HTML <IMG>
|
||||||
|
@ -427,10 +427,6 @@ nsGNOMEShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
|||||||
options.Assign("wallpaper");
|
options.Assign("wallpaper");
|
||||||
else if (aPosition == BACKGROUND_STRETCH)
|
else if (aPosition == BACKGROUND_STRETCH)
|
||||||
options.Assign("stretched");
|
options.Assign("stretched");
|
||||||
else if (aPosition == BACKGROUND_FILL)
|
|
||||||
options.Assign("zoom");
|
|
||||||
else if (aPosition == BACKGROUND_FIT)
|
|
||||||
options.Assign("scaled");
|
|
||||||
else
|
else
|
||||||
options.Assign("centered");
|
options.Assign("centered");
|
||||||
|
|
||||||
|
@ -640,14 +640,6 @@ nsWindowsShellService::SetDesktopBackground(nsIDOMElement* aElement,
|
|||||||
style.AssignLiteral("2");
|
style.AssignLiteral("2");
|
||||||
tile.AssignLiteral("0");
|
tile.AssignLiteral("0");
|
||||||
break;
|
break;
|
||||||
case BACKGROUND_FILL:
|
|
||||||
style.AssignLiteral("10");
|
|
||||||
tile.AssignLiteral("0");
|
|
||||||
break;
|
|
||||||
case BACKGROUND_FIT:
|
|
||||||
style.AssignLiteral("6");
|
|
||||||
tile.AssignLiteral("0");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
rv = regKey->WriteStringValue(NS_LITERAL_STRING("TileWallpaper"), tile);
|
rv = regKey->WriteStringValue(NS_LITERAL_STRING("TileWallpaper"), tile);
|
||||||
|
@ -2,8 +2,6 @@
|
|||||||
<!ENTITY tile.label "Tile">
|
<!ENTITY tile.label "Tile">
|
||||||
<!ENTITY center.label "Center">
|
<!ENTITY center.label "Center">
|
||||||
<!ENTITY stretch.label "Stretch">
|
<!ENTITY stretch.label "Stretch">
|
||||||
<!ENTITY fill.label "Fill">
|
|
||||||
<!ENTITY fit.label "Fit">
|
|
||||||
<!ENTITY preview.label "Preview">
|
<!ENTITY preview.label "Preview">
|
||||||
<!ENTITY color.label "Color:">
|
<!ENTITY color.label "Color:">
|
||||||
<!ENTITY setDesktopBackground.title "Set Desktop Background">
|
<!ENTITY setDesktopBackground.title "Set Desktop Background">
|
||||||
|
Loading…
Reference in New Issue
Block a user