Skip to content

Added a preference to toggle the sidebar opening on hover in compact mode #4792

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
1 change: 1 addition & 0 deletions src/browser/app/profile/zen-browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ pref('zen.view.compact.toolbar-hide-after-hover.duration', 1000);
pref('zen.view.compact.color-toolbar', true);
pref('zen.view.compact.color-sidebar', true);
pref('zen.view.compact.animate-sidebar', true);
pref('zen.view.compact.show-sidebar-and-toolbar-on-hover', true);

pref('zen.urlbar.behavior', 'floating-on-type'); // default, floating-on-type, float

Expand Down
27 changes: 20 additions & 7 deletions src/browser/base/zen-components/ZenCompactMode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -276,15 +276,28 @@ var gZenCompactModeManager = {
},

get hoverableElements() {
if (typeof this._showSidebarAndToolbarOnHover === 'undefined') {
this._showSidebarAndToolbarOnHover = Services.prefs.getBoolPref(
'zen.view.compact.show-sidebar-and-toolbar-on-hover',
true
);
}
return [
...(!this._showSidebarAndToolbarOnHover
? []
: [
{
element: this.sidebar,
screenEdge: this.sidebarIsOnRight ? 'right' : 'left',
keepHoverDuration: 100,
},
{
element: document.getElementById('zen-appcontent-navbar-container'),
screenEdge: 'top',
},
]),
{
element: this.sidebar,
screenEdge: this.sidebarIsOnRight ? 'right' : 'left',
keepHoverDuration: 100,
},
{
element: document.getElementById('zen-appcontent-navbar-container'),
screenEdge: 'top',
element: gZenVerticalTabsManager.actualWindowButtons,
},
];
},
Expand Down