diff --git a/browser/base/content/browser-customization.js b/browser/base/content/browser-customization.js index 6afb74a086e..0f0a37428cc 100644 --- a/browser/base/content/browser-customization.js +++ b/browser/base/content/browser-customization.js @@ -59,6 +59,7 @@ let CustomizationHandler = { _customizationChange: function() { gHomeButton.updatePersonalToolbarStyle(); BookmarkingUI.customizeChange(); + PlacesToolbarHelper.customizeChange(); }, _customizationEnding: function(aDetails) { diff --git a/browser/base/content/browser-places.js b/browser/base/content/browser-places.js index bcbce53931c..b63fe394be2 100644 --- a/browser/base/content/browser-places.js +++ b/browser/base/content/browser-places.js @@ -863,6 +863,10 @@ let PlacesToolbarHelper = { return document.getElementById("PlacesToolbar"); }, + get _placeholder() { + return document.getElementById("bookmarks-toolbar-placeholder"); + }, + init: function PTH_init(forceToolbarOverflowCheck) { let viewElt = this._viewElt; if (!viewElt || viewElt._placesView) @@ -883,6 +887,7 @@ let PlacesToolbarHelper = { if (forceToolbarOverflowCheck) { viewElt._placesView.updateOverflowStatus(); } + this.customizeChange(); }, customizeStart: function PTH_customizeStart() { @@ -893,6 +898,24 @@ let PlacesToolbarHelper = { } finally { this._isCustomizing = true; } + this._shouldWrap = this._getShouldWrap(); + }, + + customizeChange: function PTH_customizeChange() { + let placeholder = this._placeholder; + if (!placeholder) { + return; + } + let shouldWrapNow = this._getShouldWrap(); + if (this._shouldWrap != shouldWrapNow) { + if (shouldWrapNow) { + placeholder.setAttribute("wrap", "true"); + } else { + placeholder.removeAttribute("wrap"); + } + placeholder.classList.toggle("toolbarbutton-1", shouldWrapNow); + this._shouldWrap = shouldWrapNow; + } }, customizeDone: function PTH_customizeDone() { @@ -900,6 +923,13 @@ let PlacesToolbarHelper = { this.init(true); }, + _getShouldWrap: function PTH_getShouldWrap() { + let placement = CustomizableUI.getPlacementOfWidget("personal-bookmarks"); + let area = placement && placement.area; + let areaType = area && CustomizableUI.getAreaType(area); + return !area || CustomizableUI.TYPE_MENU_PANEL == areaType; + }, + onPlaceholderCommand: function () { let widgetGroup = CustomizableUI.getWidget("personal-bookmarks"); let widget = widgetGroup.forWindow(window); diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index afee7b38e4e..58621222642 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -1044,8 +1044,6 @@ var gBrowserInit = { if (!isLoadingBlank || !focusAndSelectUrlBar()) gBrowser.selectedBrowser.focus(); - gNavToolbox.customizeDone = BrowserToolboxCustomizeDone; - // Set up Sanitize Item this._initializeSanitizer(); @@ -1057,7 +1055,6 @@ var gBrowserInit = { gPrefService.addObserver(gHomeButton.prefDomain, gHomeButton, false); var homeButton = document.getElementById("home-button"); - gHomeButton.init(); gHomeButton.updateTooltip(homeButton); gHomeButton.updatePersonalToolbarStyle(homeButton); @@ -1250,7 +1247,6 @@ var gBrowserInit = { } BookmarkingUI.uninit(); - gHomeButton.uninit(); TabsInTitlebar.uninit(); @@ -3280,15 +3276,11 @@ function OpenBrowserWindow(options) return win; } -//XXXunf Are these still useful to keep around? +// Only here for backwards compat, we should remove this soon function BrowserCustomizeToolbar() { gCustomizeMode.enter(); } -function BrowserToolboxCustomizeDone(aToolboxChanged) { - gCustomizeMode.exit(aToolboxChanged); -} - /** * Update the global flag that tracks whether or not any edit UI (the Edit menu, * edit-related items in the context menu, and edit-related toolbar buttons @@ -4759,16 +4751,6 @@ function fireSidebarFocusedEvent() { var gHomeButton = { - init: function() { - gNavToolbox.addEventListener("customizationchange", - this.onCustomizationChange); - }, - - uninit: function() { - gNavToolbox.removeEventListener("customizationchange", - this.onCustomizationChange); - }, - prefDomain: "browser.startup.homepage", observe: function (aSubject, aTopic, aPrefName) { @@ -4821,10 +4803,6 @@ var gHomeButton = { homeButton.className.replace("toolbarbutton-1", "bookmark-item") : homeButton.className.replace("bookmark-item", "toolbarbutton-1"); }, - - onCustomizationChange: function(aEvent) { - gHomeButton.updatePersonalToolbarStyle(); - }, }; /** diff --git a/browser/base/content/browser.xul b/browser/base/content/browser.xul index 6c567598aa0..58048ee479f 100644 --- a/browser/base/content/browser.xul +++ b/browser/base/content/browser.xul @@ -858,7 +858,6 @@ cui-areatype="toolbar" removable="true"> diff --git a/browser/themes/osx/customizableui/panelUIOverlay.css b/browser/themes/osx/customizableui/panelUIOverlay.css index 5134afdfd50..9a7a5a9738b 100644 --- a/browser/themes/osx/customizableui/panelUIOverlay.css +++ b/browser/themes/osx/customizableui/panelUIOverlay.css @@ -45,8 +45,7 @@ } } -.panel-wide-item[cui-areatype="menu-panel"] > toolbarbutton, -toolbarbutton[cui-areatype="menu-panel"] { +.panelUI-grid .toolbarbutton-1 { margin-right: 0; margin-left: 0; margin-bottom: 0; diff --git a/browser/themes/shared/customizableui/panelUIOverlay.inc.css b/browser/themes/shared/customizableui/panelUIOverlay.inc.css index 277ddae1b18..2ecfb2b198a 100644 --- a/browser/themes/shared/customizableui/panelUIOverlay.inc.css +++ b/browser/themes/shared/customizableui/panelUIOverlay.inc.css @@ -311,6 +311,7 @@ toolbarpaletteitem[place="palette"] > toolbaritem > toolbarbutton { background-image: linear-gradient(rgb(38,115,191), rgb(38,125,191)); } +#customization-palette .toolbarbutton-multiline-text, #customization-palette .toolbarbutton-text { display: none; }