Skip to content

Commit

Permalink
Added option to opt-out from compact mode animation
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Dec 17, 2024
1 parent c111d32 commit 58b2ac9
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
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 @@ -112,6 +112,7 @@ pref('zen.view.compact.toolbar-flash-popup.duration', 800);
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.urlbar.behavior', 'floating-on-type'); // default, floating-on-type, float

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ height: var(--zen-toolbar-height);
}

&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
transition-delay: 0.05s;
transition-delay: 0.1s;
height: var(--zen-element-separation);
overflow: hidden;
opacity: 0;
Expand Down
4 changes: 3 additions & 1 deletion src/browser/base/zen-components/ZenCompactMode.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ var gZenCompactModeManager = {
Services.prefs.addObserver('zen.view.sidebar-expanded.on-hover', this._disableTabsOnHoverIfConflict.bind(this));
Services.prefs.addObserver('zen.tabs.vertical.right-side', this._updateSidebarIsOnRight.bind(this));

this._canAnimateSidebar = Services.prefs.getBoolPref('zen.view.compact.animate-sidebar', true);

gZenUIManager.addPopupTrackingAttribute(this.sidebar);
gZenUIManager.addPopupTrackingAttribute(document.getElementById('zen-appcontent-navbar-container'));

Expand Down Expand Up @@ -100,7 +102,7 @@ var gZenCompactModeManager = {
animateCompactMode() {
const isCompactMode = this.prefefence;
const canHideSidebar = Services.prefs.getBoolPref('zen.view.compact.hide-tabbar');
if (this._isAnimating) {
if (this._isAnimating || !this._canAnimateSidebar) {
return;
}
this._isAnimating = true;
Expand Down

0 comments on commit 58b2ac9

Please sign in to comment.