Bug 1394106 - Enable hiding toolbar grippies via pref. r=IanN
authorFrank-Rainer Grahl <frgrahl@gmx.net>
Mon, 02 Oct 2017 16:38:32 +0200
changeset 29081 763550197515c986ef8d8b958cb4037371ededa0
parent 29080 0ca324fbb10640c93c41c6284ef81f855cb87bc1
child 29082 ac416a713d15e119abbac2a1ae59b4367b79bb82
push id2068
push userclokep@gmail.com
push dateMon, 13 Nov 2017 19:02:14 +0000
treeherdercomm-beta@9c7e7ce8672b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersIanN
bugs1394106
Bug 1394106 - Enable hiding toolbar grippies via pref. r=IanN
suite/browser/browser-prefs.js
suite/common/bindings/toolbar.xml
suite/themes/modern/communicator/toolbar/toolbarBindings.xml
--- a/suite/browser/browser-prefs.js
+++ b/suite/browser/browser-prefs.js
@@ -633,16 +633,19 @@ pref("permissions.manager.defaultsUrl", 
 
 pref("lightweightThemes.update.enabled", true);
 
 // Customizable toolbar stuff
 pref("custtoolbar.personal_toolbar_folder", "");
 // Use a popup window for the customize toolbar UI
 pref("toolbar.customization.usesheet", false);
 
+// Show the toolbar and menu grippies.
+pref("browser.toolbars.grippyhidden", false);
+
 #ifdef XP_WIN
 pref("browser.taskbar.lists.enabled", true);
 pref("browser.taskbar.lists.frequent.enabled", true);
 pref("browser.taskbar.lists.recent.enabled", false);
 pref("browser.taskbar.lists.maxListItemCount", 7);
 pref("browser.taskbar.lists.tasks.enabled", true);
 pref("browser.taskbar.lists.refreshInSeconds", 120);
 pref("browser.taskbar.previews.enable", true);
--- a/suite/common/bindings/toolbar.xml
+++ b/suite/common/bindings/toolbar.xml
@@ -151,16 +151,20 @@
           <children/>
         </xul:hbox>
       </xul:hbox>
     </content>
 
     <implementation>
       <constructor>
         <![CDATA[
+          if (Services.prefs.getBoolPref("browser.toolbars.grippyhidden")) {
+            this.setAttribute("grippyhidden", "true");
+          }
+
           if (this.getAttribute("moz-collapsed") == "true" &&
               this.parentNode.localName == "toolbox")
             this.parentNode.collapseToolbar(this);
           else if (this.getAttribute("collapsed") == "true" &&
                    this.parentNode.localName == "toolbox")
             this.parentNode.createCollapsedGrippy(this);
         ]]>
       </constructor>
@@ -246,16 +250,20 @@
         <xul:hbox flex="1" class="toolbar-holder" xbl:inherits="collapsed,last-toolbar">
           <children/>
         </xul:hbox>
       </xul:hbox>
     </content>
     <implementation>
       <constructor>
         <![CDATA[
+          if (Services.prefs.getBoolPref("browser.toolbars.grippyhidden")) {
+            this.setAttribute("grippyhidden", "true");
+          }
+
           if (this.getAttribute("moz-collapsed") == "true" &&
               this.parentNode.localName == "toolbox")
             this.parentNode.collapseToolbar(this);
           else if (this.getAttribute("collapsed") == "true" &&
                    this.parentNode.localName == "toolbox")
             this.parentNode.createCollapsedGrippy(this);
         ]]>
       </constructor>
--- a/suite/themes/modern/communicator/toolbar/toolbarBindings.xml
+++ b/suite/themes/modern/communicator/toolbar/toolbarBindings.xml
@@ -7,17 +7,17 @@
 <bindings id="toolbarBindings"
           xmlns="http://www.mozilla.org/xbl"
           xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
           xmlns:xbl="http://www.mozilla.org/xbl">
 
   <binding id="toolbar-primary"
            extends="chrome://communicator/content/bindings/toolbar.xml#grippytoolbar-primary">
     <content>
-      <xul:toolbargrippy xbl:inherits="last-toolbar"
+      <xul:toolbargrippy xbl:inherits="last-toolbar,hidden=grippyhidden"
           tbattr="toolbar-grippy" class="toolbar-primary-grippy"/>
       <xul:hbox class="toolbar-holder toolbar-primary-holder" flex="1" xbl:inherits="mode,iconsize,labelalign">
         <xul:image class="toolbar-primary-icon" xbl:inherits="mode,iconsize,labelalign"/>
         <xul:hbox class="toolbar-button-box" flex="1">
           <children/>
         </xul:hbox>
       </xul:hbox>
     </content>