chore: Update toolbar flash popup duration in compact mode

This commit is contained in:
mauro-balades
2024-09-07 16:41:51 +02:00
parent 08df5e69ac
commit 6b601a7be6
2 changed files with 15 additions and 2 deletions

View File

@@ -73,7 +73,9 @@ pref('zen.theme.toolbar-themed', true);
pref('zen.theme.pill-button', false);
pref('zen.view.compact', false);
pref('zen.view.compact.hide-toolbar', false);
pref('zen.view.compact.toolbar-flash-popup', true);
pref('zen.view.compact.toolbar-flash-popup.duration', 1600);
pref('zen.view.sidebar-expanded', false);
pref('zen.view.sidebar-expanded.on-hover', false);

View File

@@ -29,7 +29,6 @@ var gZenUIManager = {
var gZenVerticalTabsManager = {
init() {
//Services.prefs.addObserver('zen.view.compact', this._updateEvent.bind(this));
Services.prefs.addObserver('zen.view.sidebar-expanded', this._updateEvent.bind(this));
Services.prefs.addObserver('zen.view.sidebar-expanded.max-width', this._updateEvent.bind(this));
Services.prefs.addObserver('zen.view.sidebar-expanded.on-hover', this._updateOnHoverVerticalTabs.bind(this));
@@ -114,6 +113,7 @@ var gZenCompactModeManager = {
init() {
Services.prefs.addObserver('zen.view.compact', this._updateEvent.bind(this));
Services.prefs.addObserver('zen.view.compact.toolbar-flash-popup.duration', this._updatedSidebarFlashDuration.bind(this));
},
get prefefence() {
@@ -132,11 +132,22 @@ var gZenCompactModeManager = {
this.preference = !this.prefefence;
},
_updatedSidebarFlashDuration() {
this._flashSidebarDuration = Services.prefs.getIntPref('zen.view.compact.toolbar-flash-popup.duration');
},
toggleSidebar() {
let sidebar = document.getElementById('navigator-toolbox');
sidebar.toggleAttribute('zen-user-show');
},
get flashSidebarDuration() {
if (this._flashSidebarDuration) {
return this._flashSidebarDuration;
}
return Services.prefs.getIntPref('zen.view.compact.toolbar-flash-popup.duration');
},
flashSidebar() {
let sidebar = document.getElementById('navigator-toolbox');
if (sidebar.matches(':hover')) {
@@ -155,7 +166,7 @@ var gZenCompactModeManager = {
sidebar.removeAttribute('flash-popup')
this._flashSidebarTimeout = null;
});
}, 1600);
}, this.flashSidebarDuration);
},
toggleToolbar() {