Bug 1354086 - update styling of normal toolbar buttons in the overflow panel, r?mikedeboer draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Wed, 05 Jul 2017 19:31:39 +0100
changeset 611495 a22ebfa1b1be72b95bd51dc0a9acb244153fb95d
parent 611494 f8be0596421938f7e95f3f878806efdb4466be7f
child 611496 e090c553a36d9e0d6824435868f03a1d3116d416
push id69242
push usergijskruitbosch@gmail.com
push dateWed, 19 Jul 2017 20:25:10 +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;