Bug 1354086 - update styling of normal toolbar buttons in the overflow panel, r=mikedeboer
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 05 Jul 2017 19:31:39 +0100
changeset 611781 ae0195a7359affc1d6e44befb827d948fece070d
parent 611780 4a279604f7ba3e11599f91a270f6c52d4ab299f5
child 611782 48e18b6a3c7ccc17ac59efa994d2b26268a59d26
push id69297
push userbmo:dakatsuka@mozilla.com
push dateThu, 20 Jul 2017 01:54:36 +0000
reviewersmikedeboer
bugs1354086
milestone56.0a1
Bug 1354086 - update styling of normal toolbar buttons in the overflow panel, r=mikedeboer MozReview-Commit-ID: 9JFz7zfmduk
browser/components/customizableui/CustomizableUI.jsm
browser/themes/shared/customizableui/panelUI.inc.css
--- a/browser/components/customizableui/CustomizableUI.jsm
+++ b/browser/components/customizableui/CustomizableUI.jsm
@@ -779,17 +779,17 @@ var CustomizableUIInternal = {
         } // Special widgets are always removable, so no need to check them
 
         if (inPrivateWindow && widget && !widget.showInPrivateBrowsing) {
           continue;
         }
 
         this.ensureButtonContextMenu(node, aAreaNode);
         if (node.localName == "toolbarbutton") {
-          if (areaIsPanel) {
+          if (areaIsPanel && !gPhotonStructure) {
             node.setAttribute("wrap", "true");
           } else {
             node.removeAttribute("wrap");
           }
         }
 
         // This needs updating in case we're resetting / undoing a reset.
         if (widget) {
@@ -965,17 +965,19 @@ var CustomizableUIInternal = {
     for (let child of aPanelContents.children) {
       if (child.localName != "toolbarbutton") {
         if (child.localName == "toolbaritem") {
           this.ensureButtonContextMenu(child, aPanelContents, true);
         }
         continue;
       }
       this.ensureButtonContextMenu(child, aPanelContents, true);
-      child.setAttribute("wrap", "true");
+      if (!gPhotonStructure) {
+        child.setAttribute("wrap", "true");
+      }
     }
 
     this.registerBuildArea(aArea, aPanelContents);
   },
 
   onWidgetAdded(aWidgetId, aArea, aPosition) {
     this.insertNode(aWidgetId, aArea, aPosition, true);
 
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -1256,16 +1256,18 @@ panelview:not([mainView]) .subviewbutton
 
 .cui-widget-panelview .subviewbutton:not(.panel-subview-footer) {
   margin-left: 4px;
   margin-right: 4px;
 }
 
 /* START photon adjustments */
 
+.widget-overflow-list > toolbarpaletteitem[place=panel] .toolbarbutton-1,
+photonpanelmultiview .widget-overflow-list .toolbarbutton-1,
 photonpanelmultiview .PanelUI-subView .subviewbutton,
 photonpanelmultiview .cui-widget-panelview .subviewbutton:not(.panel-subview-footer),
 photonpanelmultiview .subview-subheader {
   border-radius: 0;
   border-width: 0;
   margin: 0;
   padding: 4px 12px;
 }
@@ -1375,19 +1377,21 @@ photonpanelmultiview .panel-subview-foot
 }
 
 photonpanelmultiview panelview:not([mainView]) .subviewbutton.panel-subview-footer > .toolbarbutton-text {
   text-align: start;
 }
 
 /* END photon adjustments */
 
-panelview .toolbarbutton-1,
+%ifndef MOZ_PHOTON_THEME
 .widget-overflow-list > .toolbarbutton-1:not(:first-child),
-.widget-overflow-list > toolbaritem:not(:first-child) {
+.widget-overflow-list > toolbaritem:not(:first-child),
+%endif
+panelview .toolbarbutton-1 {
   margin-top: 6px;
 }
 
 panelview .toolbarbutton-1@buttonStateHover@,
 toolbarbutton.subviewbutton@buttonStateHover@,
 menu.subviewbutton@menuStateHover@,
 menuitem.subviewbutton@menuStateHover@,
 .share-provider-button@buttonStateHover@:not([checked="true"]),
@@ -1703,34 +1707,41 @@ toolbarpaletteitem[haswideitem][place="p
 %else
 #widget-overflow-mainView {
 %endif
   overflow-y: auto;
   overflow-x: hidden;
 }
 
 #widget-overflow-scroller {
-%ifndef MOZ_PHOTON_THEME
+%ifdef MOZ_PHOTON_THEME
+  margin-top: 4px;
+  margin-bottom: 4px;
+%else
   max-height: 30em;
-%endif
   margin-top: 10px;
   margin-bottom: 10px;
+%endif
 }
 
 .widget-overflow-list {
   width: @menuPanelWidth@;
+%ifndef MOZ_PHOTON_THEME
   padding-left: 10px;
   padding-right: 10px;
+%endif
 }
 
 toolbaritem[overflowedItem=true],
 .widget-overflow-list .toolbarbutton-1 {
   width: 100%;
   max-width: @menuPanelWidth@;
+%ifndef MOZ_PHOTON_THEME
   min-height: 36px;
+%endif
   background-repeat: no-repeat;
   background-position: 0 center;
 }
 
 .widget-overflow-list .toolbarbutton-1,
 .widget-overflow-list .toolbarbutton-1 > .toolbarbutton-menubutton-button {
   -moz-box-align: center;
   -moz-box-orient: horizontal;