From b5ad52b8c5b8ab10c563988cf29f6931bc8003aa Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Sun, 23 Jul 2006 18:28:47 +0000 Subject: [PATCH] Bug 345260 - handle dynamic changes to tab title, tab icon and busy (loading) state in all tabs menu. r=sspitzer/mconnor. --- toolkit/content/widgets/tabbrowser.xml | 84 +++++++++++++++------ toolkit/themes/pinstripe/global/browser.css | 3 + toolkit/themes/winstripe/global/browser.css | 4 + 3 files changed, 66 insertions(+), 25 deletions(-) diff --git a/toolkit/content/widgets/tabbrowser.xml b/toolkit/content/widgets/tabbrowser.xml index 1cc0cda45ca..75b1f809173 100644 --- a/toolkit/content/widgets/tabbrowser.xml +++ b/toolkit/content/widgets/tabbrowser.xml @@ -2733,33 +2733,62 @@ --> - - - + + + - + ]]> + + + + + + + + + + + @@ -2781,21 +2810,25 @@ menuItem.setAttribute("selected", "true"); menuItem.setAttribute("class", "menuitem-iconic alltabs-item"); - // XXX todo - // what if uri, image/favicon, title change - // while this popup is open? - // mano warns: "be careful of leaks when addressing this." menuItem.setAttribute("label", curTab.label); + menuItem.setAttribute("crop", curTab.getAttribute("crop")); menuItem.setAttribute("image", curTab.getAttribute("image")); - var URI = curTab.linkedBrowser.currentURI.spec; + if (curTab.hasAttribute("busy")) + menuItem.setAttribute("busy", curTab.getAttribute("busy")); + // XXX todo // statustext not working yet, since I don't have a menubar // reuse the menubar statustext logic + var URI = curTab.linkedBrowser.currentURI.spec; menuItem.setAttribute("statustext", URI); + + // Keep some attributes of the menuitem in sync with its + // corresponding tab (e.g. the tab label) + curTab.mCorrespondingMenuitem = menuItem; + curTab.addEventListener("DOMAttrModified", this, false); + menuItem.tab = curTab; - menuItem.addEventListener("command", - this._allTabsMenuItemCommandHandler, - false); + menuItem.addEventListener("command", this, false); this.appendChild(menuItem); } ]]> @@ -2872,6 +2905,7 @@ false + null diff --git a/toolkit/themes/pinstripe/global/browser.css b/toolkit/themes/pinstripe/global/browser.css index 10688efb862..4e52e42ac60 100644 --- a/toolkit/themes/pinstripe/global/browser.css +++ b/toolkit/themes/pinstripe/global/browser.css @@ -272,3 +272,6 @@ tabbrowser > tabbox > tabpanels { font-weight: bold; } +.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon { + list-style-image: url("chrome://global/skin/icons/loading_16_grey.gif") !important; +} diff --git a/toolkit/themes/winstripe/global/browser.css b/toolkit/themes/winstripe/global/browser.css index 496c4d4a7b1..9921d34fbfa 100644 --- a/toolkit/themes/winstripe/global/browser.css +++ b/toolkit/themes/winstripe/global/browser.css @@ -165,3 +165,7 @@ tab { font-weight: bold; } +.alltabs-item[busy] > .menu-iconic-left > .menu-iconic-icon { + list-style-image: url("chrome://global/skin/throbber/Throbber-small.gif"); + opacity: 0.5; +}