mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-09 17:31:47 +09:00
[Basilisk] Use mousemove events instead of MousePosTracker for hiding the navigation bar in fullscreen
* Tag #336
This commit is contained in:
parent
3687a6bd06
commit
44709de216
1 changed files with 10 additions and 25 deletions
|
|
@ -322,15 +322,9 @@ var FullScreen = {
|
|||
document.addEventListener("popuphidden", this._setPopupOpen, false);
|
||||
// If it is not safe to collapse, add the mouse position tracker or
|
||||
// else it won't be possible to hide the navigation toolbox again
|
||||
if (!this._safeToCollapse()) {
|
||||
let rect = gBrowser.mPanelContainer.getBoundingClientRect();
|
||||
this._mouseTargetRect = {
|
||||
top: rect.top + 50,
|
||||
bottom: rect.bottom,
|
||||
left: rect.left,
|
||||
right: rect.right
|
||||
};
|
||||
MousePosTracker.addListener(this);
|
||||
if (gPrefService.getBoolPref("browser.fullscreen.autohide")) {
|
||||
gBrowser.mPanelContainer.addEventListener("mousemove",
|
||||
this._collapseCallback, false);
|
||||
}
|
||||
// In DOM fullscreen mode, we hide toolbars with CSS
|
||||
if (!document.fullscreenElement)
|
||||
|
|
@ -468,7 +462,8 @@ var FullScreen = {
|
|||
|
||||
cleanup: function () {
|
||||
if (!window.fullScreen) {
|
||||
MousePosTracker.removeListener(this);
|
||||
gBrowser.mPanelContainer.removeEventListener("mousemove",
|
||||
this._collapseCallback, false);
|
||||
document.removeEventListener("keypress", this._keyToggleCallback, false);
|
||||
document.removeEventListener("popupshown", this._setPopupOpen, false);
|
||||
document.removeEventListener("popuphidden", this._setPopupOpen, false);
|
||||
|
|
@ -497,17 +492,12 @@ var FullScreen = {
|
|||
.getInterface(Ci.nsIDOMWindowUtils);
|
||||
},
|
||||
|
||||
getMouseTargetRect: function()
|
||||
{
|
||||
return this._mouseTargetRect;
|
||||
},
|
||||
|
||||
// Event callbacks
|
||||
_expandCallback: function()
|
||||
{
|
||||
FullScreen.showNavToolbox();
|
||||
},
|
||||
onMouseEnter: function()
|
||||
_collapseCallback: function()
|
||||
{
|
||||
FullScreen.hideNavToolbox();
|
||||
},
|
||||
|
|
@ -588,14 +578,8 @@ var FullScreen = {
|
|||
|
||||
// Track whether mouse is near the toolbox
|
||||
if (trackMouse && !this.useLionFullScreen) {
|
||||
let rect = gBrowser.mPanelContainer.getBoundingClientRect();
|
||||
this._mouseTargetRect = {
|
||||
top: rect.top + 50,
|
||||
bottom: rect.bottom,
|
||||
left: rect.left,
|
||||
right: rect.right
|
||||
};
|
||||
MousePosTracker.addListener(this);
|
||||
gBrowser.mPanelContainer.addEventListener("mousemove",
|
||||
this._collapseCallback, false);
|
||||
}
|
||||
|
||||
this._isChromeCollapsed = false;
|
||||
|
|
@ -622,7 +606,8 @@ var FullScreen = {
|
|||
gNavToolbox.style.marginTop =
|
||||
-gNavToolbox.getBoundingClientRect().height + "px";
|
||||
this._isChromeCollapsed = true;
|
||||
MousePosTracker.removeListener(this);
|
||||
gBrowser.mPanelContainer.removeEventListener("mousemove",
|
||||
this._collapseCallback, false);
|
||||
},
|
||||
|
||||
_updateToolbars: function (aEnterFS) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue