mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 884492 - run TabsInTitlebar._update when nodes are added/removed in tab/menubar, r=mconley
This commit is contained in:
parent
35947d2cb9
commit
e45753dc4a
@ -4197,6 +4197,17 @@ var TabsInTitlebar = {
|
||||
this._menuObserver.observe(menu, {attributes: true});
|
||||
|
||||
gNavToolbox.addEventListener("customization-transitionend", this);
|
||||
|
||||
this.onAreaReset = function(aArea) {
|
||||
if (aArea == CustomizableUI.AREA_TABSTRIP || aArea == CustomizableUI.AREA_MENUBAR)
|
||||
this._update(true);
|
||||
};
|
||||
this.onWidgetAdded = this.onWidgetRemoved = function(aWidgetId, aArea) {
|
||||
if (aArea == CustomizableUI.AREA_TABSTRIP || aArea == CustomizableUI.AREA_MENUBAR)
|
||||
this._update(true);
|
||||
};
|
||||
CustomizableUI.addListener(this);
|
||||
|
||||
this._initialized = true;
|
||||
#endif
|
||||
},
|
||||
@ -4441,6 +4452,7 @@ var TabsInTitlebar = {
|
||||
this._initialized = false;
|
||||
Services.prefs.removeObserver(this._prefName, this);
|
||||
this._menuObserver.disconnect();
|
||||
CustomizableUI.removeListener(this);
|
||||
#endif
|
||||
}
|
||||
};
|
||||
|
@ -295,6 +295,9 @@ skip-if = true # disabled until the tree view is added
|
||||
[browser_tab_dragdrop.js]
|
||||
[browser_tab_dragdrop2.js]
|
||||
[browser_tab_dragdrop2_frame1.xul]
|
||||
[browser_tabbar_big_widgets.js]
|
||||
skip-if = os == "linux" # No tabs in titlebar on linux
|
||||
|
||||
[browser_tabfocus.js]
|
||||
[browser_tabopen_reflows.js]
|
||||
[browser_tabs_isActive.js]
|
||||
|
@ -0,0 +1,29 @@
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
const kButtonId = "test-tabbar-size-with-large-buttons";
|
||||
|
||||
function test() {
|
||||
registerCleanupFunction(cleanup);
|
||||
let titlebar = document.getElementById("titlebar");
|
||||
let originalHeight = titlebar.getBoundingClientRect().height;
|
||||
let button = document.createElement("toolbarbutton");
|
||||
button.id = kButtonId;
|
||||
button.setAttribute("style", "min-height: 100px");
|
||||
gNavToolbox.palette.appendChild(button);
|
||||
CustomizableUI.addWidgetToArea(kButtonId, CustomizableUI.AREA_TABSTRIP);
|
||||
let currentHeight = titlebar.getBoundingClientRect().height;
|
||||
ok(currentHeight > originalHeight, "Titlebar should have grown");
|
||||
CustomizableUI.removeWidgetFromArea(kButtonId);
|
||||
currentHeight = titlebar.getBoundingClientRect().height;
|
||||
is(currentHeight, originalHeight, "Titlebar should have gone back to its original size.");
|
||||
}
|
||||
|
||||
function cleanup() {
|
||||
let btn = document.getElementById(kButtonId);
|
||||
if (btn) {
|
||||
btn.remove();
|
||||
}
|
||||
}
|
||||
|
@ -401,7 +401,7 @@ let CustomizableUIInternal = {
|
||||
|
||||
this.insertWidgetBefore(node, currentNode, container, aArea);
|
||||
if (gResetting) {
|
||||
this.notifyListeners("onWidgetReset", id);
|
||||
this.notifyListeners("onWidgetReset", id, aArea);
|
||||
}
|
||||
}
|
||||
|
||||
@ -450,6 +450,10 @@ let CustomizableUIInternal = {
|
||||
}
|
||||
}
|
||||
|
||||
if (gResetting) {
|
||||
this.notifyListeners("onAreaReset", aArea);
|
||||
}
|
||||
|
||||
this.endBatchUpdate();
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user