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
--- 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;