Bug 624157 - When maximising window, scroll buttons remain in tab bar. r=enn a=a

This commit is contained in:
Dão Gottwald 2011-01-20 16:38:26 +01:00
parent c205031cac
commit 0cd782a693
5 changed files with 21 additions and 15 deletions

View File

@ -97,10 +97,6 @@ toolbar[printpreview="true"] {
-moz-binding: url("chrome://global/content/bindings/general.xml#windowdragbox");
}
#main-window[tabsintitlebar] #TabsToolbar {
-moz-binding: url("chrome://global/content/bindings/toolbar.xml#toolbar-drag");
}
#titlebar-spacer {
pointer-events: none;
}

View File

@ -4914,6 +4914,17 @@ var TabsInTitlebar = {
titlebar.style.marginBottom = - Math.min(distance, maxMargin) + "px";
docElement.setAttribute("tabsintitlebar", "true");
if (!this._draghandle) {
let tmp = {};
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
this._draghandle = new tmp.WindowDraggingElement(tabsToolbar, window);
this._draghandle.mouseDownCheck = function () {
return !this._dragBindingAlive &&
this.ownerDocument.documentElement
.getAttribute("tabsintitlebar") == "true";
};
}
} else {
docElement.removeAttribute("tabsintitlebar");

View File

@ -58,10 +58,6 @@ WindowDraggingElement.prototype = {
aEvent.getPreventDefault())
return false;
// Maybe we have been removed from the document
if (!this._elem._alive)
return false;
let target = aEvent.originalTarget, parent = aEvent.originalTarget;
// The target may be inside an embedded iframe or browser. (bug 615152)

View File

@ -160,14 +160,15 @@
<binding id="statusbar-drag"
extends="chrome://global/content/bindings/general.xml#statusbar">
<implementation>
<field name="_alive">true</field>
<field name="_dragBindingAlive">true</field>
<constructor>
if (!this._draggableStarted) {
this._draggableStarted = true;
try {
let tmp = {};
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
new tmp.WindowDraggingElement(this, window);
let draghandle = new tmp.WindowDraggingElement(this, window);
draghandle.mouseDownCheck = function () this._dragBindingAlive;
} catch (e) {}
}
</constructor>
@ -266,14 +267,15 @@
<binding id="windowdragbox">
<implementation>
<field name="_alive">true</field>
<field name="_dragBindingAlive">true</field>
<constructor>
if (!this._draggableStarted) {
this._draggableStarted = true;
try {
let tmp = {};
Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp);
new tmp.WindowDraggingElement(this, window);
let draghandle = new tmp.WindowDraggingElement(this, window);
draghandle.mouseDownCheck = function () this._dragBindingAlive;
} catch (e) {}
}
</constructor>

View File

@ -475,7 +475,7 @@
<binding id="toolbar-drag"
extends="chrome://global/content/bindings/toolbar.xml#toolbar">
<implementation>
<field name="_alive">true</field>
<field name="_dragBindingAlive">true</field>
<constructor><![CDATA[
if (!this._draggableStarted) {
this._draggableStarted = true;
@ -485,8 +485,9 @@
let draggableThis = new tmp.WindowDraggingElement(this, window);
draggableThis.mouseDownCheck = function(e) {
// Don't move while customizing.
return !this.parentNode.customizing;
}
return this._dragBindingAlive &&
this.getAttribute("customizing") != "true";
};
} catch (e) {}
}
]]></constructor>