Bug 1367909 and bug 1368973 - fix sidebar header button cropping and hover state, r?bgrins draft
authorGijs Kruitbosch <gijskruitbosch@gmail.com>
Thu, 08 Jun 2017 13:26:36 +0100
changeset 590948 7379be9ca937ef95f0b9bdcabf27d62d5edc6307
parent 589544 4dd1d17ba22660b8f5869a707f2e4e9f9dd5be5b
child 632379 2bfdecfbf12ecd2fc6b887a9b7cbbcd5794c9c87
push id62908
push userbmo:gijskruitbosch+bugs@gmail.com
push dateThu, 08 Jun 2017 12:39:34 +0000
reviewersbgrins
bugs1367909, 1368973
milestone55.0a1
Bug 1367909 and bug 1368973 - fix sidebar header button cropping and hover state, r?bgrins MozReview-Commit-ID: 3yPdxBAHXo9
browser/base/content/browser.xul
--- a/browser/base/content/browser.xul
+++ b/browser/base/content/browser.xul
@@ -1207,21 +1207,25 @@
 
   <deck id="content-deck" flex="1">
     <hbox flex="1" id="browser">
       <vbox id="browser-border-start" hidden="true" layer="true"/>
       <vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
         <sidebarheader id="sidebar-header" align="center">
           <toolbarbutton id="sidebar-switcher-target" flex="1" class="tabbable">
             <image id="sidebar-icon" consumeanchor="sidebar-switcher-target"/>
-            <label id="sidebar-title" persist="value" crop="end" control="sidebar"/>
+            <label id="sidebar-title" persist="value" crop="end" flex="1" control="sidebar"/>
             <image id="sidebar-switcher-arrow"/>
-            <spacer flex="1"/>
           </toolbarbutton>
           <image id="sidebar-throbber"/>
+# To ensure the button label's intrinsic width doesn't expand the sidebar
+# if the label is long, the button needs flex=1.
+# To ensure the button doesn't expand unnecessarily for short labels, the
+# spacer should significantly out-flex the button.
+          <spacer flex="1000"/>
           <toolbarbutton id="sidebar-close" class="tabbable" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="SidebarUI.hide();"/>
         </sidebarheader>
         <browser id="sidebar" flex="1" autoscroll="false" disablehistory="true" disablefullscreen="true"
                   style="min-width: 14em; width: 18em; max-width: 36em;" tooltip="aHTMLTooltip"/>
       </vbox>
 
       <splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" hidden="true"/>
       <vbox id="appcontent" flex="1">