mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-05 19:08:18 +00:00
Refactor ZenUIManager to improve sidebar buttons customization and handle sidebar visibility and expansion based on user preferences.
This commit is contained in:
@@ -76,20 +76,29 @@ var gZenVerticalTabsManager = {
|
||||
const customizationTarget = document.getElementById('nav-bar-customization-target');
|
||||
const tabboxWrapper = document.getElementById('zen-tabbox-wrapper');
|
||||
const browser = document.getElementById('browser');
|
||||
if (Services.prefs.getBoolPref('zen.view.sidebar-expanded')) {
|
||||
this.navigatorToolbox.setAttribute('zen-expanded', 'true');
|
||||
this.navigatorToolbox.prepend(topButtons);
|
||||
browser.prepend(this.navigatorToolbox);
|
||||
} else {
|
||||
this.navigatorToolbox.removeAttribute('zen-expanded');
|
||||
customizationTarget.prepend(topButtons);
|
||||
tabboxWrapper.prepend(this.navigatorToolbox);
|
||||
}
|
||||
if (Services.prefs.getBoolPref('zen.tabs.vertical.right-side')) {
|
||||
this.navigatorToolbox.setAttribute('zen-right-side', 'true');
|
||||
} else {
|
||||
this.navigatorToolbox.removeAttribute('zen-right-side');
|
||||
}
|
||||
if (Services.prefs.getBoolPref('zen.view.sidebar-expanded')) {
|
||||
this.navigatorToolbox.setAttribute('zen-expanded', 'true');
|
||||
} else {
|
||||
this.navigatorToolbox.removeAttribute('zen-expanded');
|
||||
}
|
||||
|
||||
if (this.navigatorToolbox.hasAttribute('zen-expanded') && !this.navigatorToolbox.hasAttribute('zen-right-side')
|
||||
&& !Services.prefs.getBoolPref('zen.view.compact') && !Services.prefs.getBoolPref('zen.view.sidebar-expanded.on-hover')) {
|
||||
this.navigatorToolbox.prepend(topButtons);
|
||||
browser.prepend(this.navigatorToolbox);
|
||||
} else {
|
||||
customizationTarget.prepend(topButtons);
|
||||
tabboxWrapper.prepend(this.navigatorToolbox);
|
||||
}
|
||||
|
||||
// Always move the splitter next to the sidebar
|
||||
this.navigatorToolbox.after(document.getElementById('zen-sidebar-splitter'));
|
||||
|
||||
this._updateOnHoverVerticalTabs();
|
||||
},
|
||||
|
||||
|
@@ -414,7 +414,7 @@
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
& .zen-sidebar-action-button {
|
||||
& #titlebar .zen-sidebar-action-button {
|
||||
width: 100%;
|
||||
border-radius: var(--zen-button-border-radius);
|
||||
|
||||
|
Reference in New Issue
Block a user