Bug 1468249 - Avoid resizing the TP toggle in the main menu in touch mode. r=dao draft
authorJohann Hofmann <jhofmann@mozilla.com>
Wed, 27 Jun 2018 21:45:41 +0200
changeset 819257 cb5d7b9430f3fa392b7a5b8c91e6e5e2d6e452df
parent 819215 547144f5596c1a146b208d68d93950a6313080ca
push id116473
push userbmo:jhofmann@mozilla.com
push dateTue, 17 Jul 2018 12:14:09 +0000
reviewersdao
bugs1468249, 1468311
milestone63.0a1
Bug 1468249 - Avoid resizing the TP toggle in the main menu in touch mode. r=dao 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 id="appMenu-tp-container" hidden="true">
+        <toolbaritem id="appMenu-tp-container" hidden="true" 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"
                          enabled="false"
                          oncommand="TrackingProtection.onGlobalToggleCommand();" />
         </toolbaritem>
         <toolbarseparator id="appMenu-tp-separator" hidden="true" />
         <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;