Flash sidebar on tab select in compact mode.

This commit is contained in:
brahim
2024-09-07 14:10:59 +02:00
parent faecb40361
commit 1f6e24c192
3 changed files with 31 additions and 2 deletions

View File

@@ -110,6 +110,8 @@ var gZenVerticalTabsManager = {
};
var gZenCompactModeManager = {
_flashSidebarTimeout: null,
init() {
Services.prefs.addObserver('zen.view.compact', this._updateEvent.bind(this));
},
@@ -135,6 +137,27 @@ var gZenCompactModeManager = {
sidebar.toggleAttribute('zen-user-show');
},
flashSidebar() {
let sidebar = document.getElementById('navigator-toolbox');
if (sidebar.matches(':hover')) {
return;
}
if (this._flashSidebarTimeout) {
clearTimeout(this._flashSidebarTimeout);
} else {
window.requestAnimationFrame(() =>
sidebar.setAttribute('flash-popup', '')
);
}
this._flashSidebarTimeout =
setTimeout(() => {
window.requestAnimationFrame(() => {
sidebar.removeAttribute('flash-popup')
this._flashSidebarTimeout = null;
});
}, 1600);
},
toggleToolbar() {
let toolbar = document.getElementById('zen-appcontent-navbar-container');
toolbar.toggleAttribute('zen-user-show');

View File

@@ -95,6 +95,7 @@
#navigator-toolbox:hover,
#navigator-toolbox:focus-within,
#navigator-toolbox[zen-user-show],
#navigator-toolbox[flash-popup],
#navigator-toolbox[movingtab],
#mainPopupSet:has(> #appMenu-popup:hover) ~ toolbox,
#navigator-toolbox:has(.tabbrowser-tab:active),
@@ -187,6 +188,7 @@
#navigator-toolbox:hover,
#navigator-toolbox:focus-within,
#navigator-toolbox[zen-user-show],
#navigator-toolbox[flash-popup],
#navigator-toolbox[movingtab],
#mainPopupSet:has(> #appMenu-popup:hover) ~ toolbox,
#navigator-toolbox:has(.tabbrowser-tab:active),

View File

@@ -1,8 +1,8 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index 282e7f31fe158d929130c17628f7e30f690fd666..2eb7123611947c5bc3da4ae864dd6f6f68fa6f9e 100644
index 282e7f31fe158d929130c17628f7e30f690fd666..c4e231382846ab646fadb6544fa7d78fdcdf7769 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -1387,9 +1387,7 @@
@@ -1387,10 +1387,11 @@
_handleTabSelect(aInstant) {
let selectedTab = this.selectedItem;
@@ -11,5 +11,9 @@ index 282e7f31fe158d929130c17628f7e30f690fd666..2eb7123611947c5bc3da4ae864dd6f6f
- }
+ this.arrowScrollbox.ensureElementIsVisible(selectedTab, aInstant);
+ if (!aInstant && Services.prefs.getBoolPref('zen.view.compact')) {
+ gZenCompactModeManager.flashSidebar();
+ }
selectedTab._notselectedsinceload = false;
}