chore: Update sidebar-expanded max-width preference and UI styling

This commit is contained in:
Mauro Balades
2024-08-02 17:05:43 +02:00
parent 639806e13f
commit 6862e6cbc6
3 changed files with 26 additions and 4 deletions

View File

@@ -69,6 +69,7 @@ pref('zen.view.compact', false);
pref('zen.view.compact.hide-toolbar', false);
pref('zen.view.sidebar-expanded', false);
pref('zen.view.sidebar-expanded.show-button', true);
pref('zen.view.sidebar-expanded.max-width', 400);
// Pref to enable the new profiles (TODO: Check this out!)
//pref("browser.profiles.enabled", true);

View File

@@ -26,9 +26,26 @@ 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', this._updateEvent.bind(this));
Services.prefs.addObserver('zen.view.sidebar-expanded.max-width', this._updateEvent.bind(this));
this._updateMaxWidth();
},
_updateEvent() {
this._updateMaxWidth();
},
_updateMaxWidth() {
let isCompactMode = Services.prefs.getBoolPref('zen.view.compact');
let expanded = this.expanded;
let maxWidth = Services.prefs.getIntPref('zen.view.sidebar-expanded.max-width');
let toolbox = document.getElementById('navigator-toolbox');
if (expanded && !isCompactMode) {
toolbox.style.maxWidth = `${maxWidth}px`;
} else {
toolbox.style.removeProperty('maxWidth');
}
},
get expanded() {
return Services.prefs.getBoolPref('zen.view.sidebar-expanded');

View File

@@ -222,7 +222,10 @@ button.popup-notification-dropmarker {
#navigator-toolbox {
min-width: 55px;
max-width: 55px;
transition: .4s !important;
}
#zen-tabbox-wrapper:has(#zen-sidebar-splitter:not([state="dragging"])) #navigator-toolbox {
transition: .3s !important;
}
#navigator-toolbox toolbar#TabsToolbar {
@@ -764,6 +767,8 @@ panelmultiview {
}
.tabbrowser-tab {
max-width: unset !important;
&:not([pinned]) {
width: 100%;
@@ -819,8 +824,7 @@ panelmultiview {
#zen-workspaces-button {
width: -moz-available !important;
padding-left: 10px;
padding-right: 10px;
padding: 2px 10px;
}
#zen-sidebar-icons-wrapper {