Detect position change of the tab bar.

This seems required for #895
This commit is contained in:
YUKI Hiroshi 2015-11-06 14:54:07 +09:00
parent 0ac67fcdff
commit 38f01ba0a9

View File

@ -162,13 +162,38 @@ BrowserUIShowHideObserver.prototype = {
)
return;
var toolbarVisible = !TST.ownerToolbar.collapsed;
var tabbarVisible = this.owner.browser.tabContainer.visible;
var placeHolderVisible = !TST.tabStripPlaceHolder.collapsed;
var tabbarVisibilityMismatching = (
toolbarVisible != placeHolderVisible ||
tabbarVisible != placeHolderVisible
);
var tabbar = this.owner.browser.tabContainer;
var placeHolder = TST.tabStripPlaceHolder;
var tabbarVisibilityMismatching = false;
{
let toolbarVisible = !TST.ownerToolbar.collapsed;
let tabbarVisible = tabbar.visible;
let placeHolderVisible = !placeHolder.collapsed;
tabbarVisibilityMismatching = (
toolbarVisible != placeHolderVisible ||
tabbarVisible != placeHolderVisible
);
}
var tabbarMatrixMismatching = false;
{
let tabbarBox = tabbar.boxObject;
let tabbarMatrix = JSON.stringify({
x: tabbarBox.screenX,
y: tabbarBox.screenY,
w: tabbarBox.width,
h: tabbarBox.height
});
let placeHolderBox = placeHolder.boxObject;
let placeHolderMatrix = JSON.stringify({
x: placeHolderBox.screenX,
y: placeHolderBox.screenY,
w: placeHolderBox.width,
h: placeHolderBox.height
});
tabbarMatrixMismatching = tabbarMatrix != placeHolderMatrix;
}
if (
// I must ignore show/hide of elements managed by TST,
@ -183,7 +208,8 @@ BrowserUIShowHideObserver.prototype = {
// different visibility, then the tab bar is shown or
// hidden by "auto hide tab bar" feature of someone
// (Pale Moon, Tab Mix Plus, etc.)
!tabbarVisibilityMismatching
!tabbarVisibilityMismatching &&
!tabbarMatrixMismatching
)
return;