mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-21 09:49:14 +00:00
Bug 625367 - With tabs in the title bar, Firefox dialogs and target=_blank links open a new maximized window with tabs cut off at the top. r=gavin
This commit is contained in:
parent
713aa1183e
commit
1920caa385
@ -5068,23 +5068,19 @@ var TabsInTitlebar = {
|
||||
let titlebar = $("titlebar");
|
||||
|
||||
if (allowed) {
|
||||
let availTop = screen.availTop;
|
||||
function top(ele) ele.boxObject.screenY - availTop;
|
||||
function bottom(ele) top(ele) + rect(ele).height;
|
||||
function rect(ele) ele.getBoundingClientRect();
|
||||
|
||||
let tabsToolbar = $("TabsToolbar");
|
||||
|
||||
let appmenuButtonBox = $("appmenu-button-container");
|
||||
let captionButtonsBox = $("titlebar-buttonbox");
|
||||
|
||||
this._sizePlaceholder("appmenu-button", rect(appmenuButtonBox).width);
|
||||
this._sizePlaceholder("caption-buttons", rect(captionButtonsBox).width);
|
||||
|
||||
let maxMargin = top(gNavToolbox);
|
||||
let tabsBottom = maxMargin + rect(tabsToolbar).height;
|
||||
let titlebarBottom = Math.max(bottom(appmenuButtonBox), bottom(captionButtonsBox));
|
||||
let distance = tabsBottom - titlebarBottom;
|
||||
titlebar.style.marginBottom = - Math.min(distance, maxMargin) + "px";
|
||||
let tabsToolbarRect = rect(tabsToolbar);
|
||||
let titlebarTop = rect($("titlebar-content")).top;
|
||||
titlebar.style.marginBottom = - Math.min(tabsToolbarRect.top - titlebarTop,
|
||||
tabsToolbarRect.height) + "px";
|
||||
|
||||
docElement.setAttribute("tabsintitlebar", "true");
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user