Bug 1468249 - Avoid resizing the TP toggle in the main menu in touch mode. r=dao, a=ritu
authorJohann Hofmann <jhofmann@mozilla.com>
Wed, 27 Jun 2018 21:45:41 +0200
changeset 480779 de436be5e56eced99d5a2c8c06fd401a1c74cb3a
parent 480778 476aa14b33e32c344756376c78eca6f4e3d32a4f
child 480780 83e81646f5005a861ef203bb34b3fbf9bfd29359
push id1757
push userffxbld-merge
push dateFri, 24 Aug 2018 17:02:43 +0000
treeherdermozilla-release@736023aebdb1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao, ritu
bugs1468249, 1468311
milestone62.0
Bug 1468249 - Avoid resizing the TP toggle in the main menu in touch mode. r=dao, a=ritu This also fixes bug 1468311, because it made the touch control significantly more annoying. Now, the TP toggle in the main menu has the right size, but tapping outside of it still doesn't trigger it, though at least the menu is not closed so the user can easily tap again. MozReview-Commit-ID: eRfAEwXype
browser/components/customizableui/content/panelUI.inc.xul
browser/themes/shared/customizableui/panelUI.inc.css
--- a/browser/components/customizableui/content/panelUI.inc.xul
+++ b/browser/components/customizableui/content/panelUI.inc.xul
@@ -204,25 +204,24 @@
                          oncommand="gSync.doSync();"
                          closemenu="none">
             <observes element="sync-status" attribute="syncstatus"/>
             <observes element="sync-status" attribute="tooltiptext"/>
             <observes element="sync-status" attribute="onmouseover"/>
           </toolbarbutton>
         </toolbaritem>
         <toolbarseparator class="sync-ui-item"/>
-        <toolbaritem>
+        <toolbaritem closemenu="none">
           <toolbarbutton id="appMenu-tp-label"
                          tooltiptext="&trackingProtection.tooltip;"
                          class="subviewbutton subviewbutton-iconic"
-                         oncommand="TrackingProtection.openPreferences('appMenu-trackingprotection');"
+                         oncommand="TrackingProtection.openPreferences('appMenu-trackingprotection'); PanelUI.hide();"
                          label="&trackingProtection.title;"/>
           <toolbarseparator orient="vertical"/>
           <toolbarbutton id="appMenu-tp-toggle"
-                         closemenu="none"
                          class="subviewkeynav"
                          observes="trackingProtectionBroadcaster"
                          oncommand="TrackingProtection.onGlobalToggleCommand();" />
         </toolbaritem>
         <toolbarseparator />
         <toolbarbutton id="appMenu-new-window-button"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newNavigatorCmd.label;"
--- a/browser/themes/shared/customizableui/panelUI.inc.css
+++ b/browser/themes/shared/customizableui/panelUI.inc.css
@@ -606,16 +606,22 @@ toolbarbutton[constrain-size="true"][cui
   margin-top: 4px;
   margin-bottom: 4px;
   margin-inline-start: 1px;
   margin-inline-end: 7px;
   padding: 2px;
   transition: padding .2s ease;
 }
 
+/* Don't resize the toggle in touch mode. */
+#appMenu-popup[touchmode] #appMenu-tp-toggle {
+  margin-top: 12px;
+  margin-bottom: 12px;
+}
+
 #appMenu-tp-toggle::before {
   position: relative;
   display: block;
   content: "";
   width: 10px;
   height: 10px;
   border-radius: 10px;
   background: white;