From 5f7deb47a52bc9f6c0baf8723844b448e570883a Mon Sep 17 00:00:00 2001 From: "mozilla.mano%sent.com" Date: Sat, 26 Aug 2006 07:27:54 +0000 Subject: [PATCH] Bug 250129 - Improve toolbar customization UE on OS X. r=mconnor. --- browser/base/Makefile.in | 4 + browser/base/content/browser-doctype.inc | 4 + browser/base/content/browser.js | 23 +++- browser/base/content/browser.xul | 60 +++++---- browser/base/content/customizeToolbarSheet.js | 49 +++++++ .../base/content/customizeToolbarSheet.xul | 122 ++++++++++++++++++ browser/base/jar.mn | 4 + browser/themes/pinstripe/browser/browser.css | 10 ++ extensions/reporter/jar.mn | 1 + toolkit/content/customizeToolbar.js | 17 ++- 10 files changed, 265 insertions(+), 29 deletions(-) create mode 100644 browser/base/content/customizeToolbarSheet.js create mode 100644 browser/base/content/customizeToolbarSheet.xul diff --git a/browser/base/Makefile.in b/browser/base/Makefile.in index 32f172fb95b..ee7a72ef35c 100644 --- a/browser/base/Makefile.in +++ b/browser/base/Makefile.in @@ -56,6 +56,10 @@ ifneq (,$(filter windows gtk2 mac cocoa, $(MOZ_WIDGET_TOOLKIT))) DEFINES += -DHAVE_SHELL_SERVICE=1 endif +ifneq (,$(filter mac cocoa, $(MOZ_WIDGET_TOOLKIT))) +DEFINES += -DTOOLBAR_CUSTOMIZATION_SHEET +endif + ifndef MOZ_BRANDING_DIRECTORY libs locale:: $(INSTALL) $(srcdir)/content/browserconfig.properties $(DIST)/bin diff --git a/browser/base/content/browser-doctype.inc b/browser/base/content/browser-doctype.inc index 05daaf8a80a..f49c8d420c2 100644 --- a/browser/base/content/browser-doctype.inc +++ b/browser/base/content/browser-doctype.inc @@ -11,6 +11,10 @@ %charsetDTD; %findBarDTD; +#ifdef TOOLBAR_CUSTOMIZATION_SHEET + + %customizeToolbarDTD; +#endif #ifdef MOZ_PLACES %placesDTD; diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index ed749a51b9c..b9c04b633f2 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3362,12 +3362,29 @@ function BrowserCustomizeToolbar() var cmd = document.getElementById("cmd_CustomizeToolbars"); cmd.setAttribute("disabled", "true"); - window.openDialog("chrome://global/content/customizeToolbar.xul", "CustomizeToolbar", - "chrome,all,dependent", document.getElementById("navigator-toolbox")); +#ifdef TOOLBAR_CUSTOMIZATION_SHEET + document.getElementById("customizeToolbarSheetBox").hidden = false; + + // New tabs are breaking the xul stack + document.getElementById("cmd_newNavigatorTab") + .setAttribute("disabled", "true"); + getBrowser()._blockDblClick = true; +#else + window.openDialog("chrome://global/content/customizeToolbar.xul", + "CustomizeToolbar", + "chrome,all,dependent", + document.getElementById("navigator-toolbox")); +#endif } function BrowserToolboxCustomizeDone(aToolboxChanged) { +#ifdef TOOLBAR_CUSTOMIZATION_SHEET + document.getElementById("customizeToolbarSheetBox").hidden = true; + document.getElementById("cmd_newNavigatorTab").removeAttribute("disabled"); + getBrowser()._blockDblClick = false; +#endif + // Update global UI elements that may have been added or removed if (aToolboxChanged) { gURLBar = document.getElementById("urlbar"); @@ -3437,8 +3454,10 @@ function BrowserToolboxCustomizeDone(aToolboxChanged) bookmarksBar._init(); #endif +#ifndef TOOLBAR_CUSTOMIZATION_SHEET // XXX Shouldn't have to do this, but I do window.focus(); +#endif } var FullScreen = diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index d1376edc16a..e0d235821a7 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -477,32 +477,46 @@ #endif - - + + + - + /> + + +#ifdef TOOLBAR_CUSTOMIZATION_SHEET +