mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-04 17:06:35 +00:00
Enhance sidebar behavior and styles: force expanded sidebar on initialization, adjust margins, and refine transition effects for compact mode
This commit is contained in:
@@ -211,6 +211,8 @@ var gZenVerticalTabsManager = {
|
|||||||
|
|
||||||
_preCustomize() {
|
_preCustomize() {
|
||||||
this._updateEvent({ forceMultipleToolbar: true });
|
this._updateEvent({ forceMultipleToolbar: true });
|
||||||
|
this.navigatorToolbox.setAttribute('zen-sidebar-expanded', 'true');
|
||||||
|
document.documentElement.setAttribute('zen-sidebar-expanded', 'true'); // force expanded sidebar
|
||||||
},
|
},
|
||||||
|
|
||||||
initializePreferences(updateEvent) {
|
initializePreferences(updateEvent) {
|
||||||
|
@@ -90,13 +90,20 @@
|
|||||||
:root:not([inDOMFullscreen='true']):not([chromehidden~='location']):not([chromehidden~='toolbar']) {
|
:root:not([inDOMFullscreen='true']):not([chromehidden~='location']):not([chromehidden~='toolbar']) {
|
||||||
& #zen-tabbox-wrapper {
|
& #zen-tabbox-wrapper {
|
||||||
margin: var(--zen-element-separation);
|
margin: var(--zen-element-separation);
|
||||||
margin-left: 0;
|
|
||||||
margin-top: 0;
|
margin-top: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not([zen-right-side='true']) #zen-tabbox-wrapper {
|
||||||
|
margin-left: 0;
|
||||||
|
}
|
||||||
|
|
||||||
&[zen-right-side='true'] #zen-tabbox-wrapper {
|
&[zen-right-side='true'] #zen-tabbox-wrapper {
|
||||||
margin-right: 0;
|
margin-right: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&:not([zen-no-padding='true']) #zen-tabbox-wrapper {
|
||||||
|
margin-left: 1px;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#tabbrowser-tabbox {
|
#tabbrowser-tabbox {
|
||||||
|
@@ -6,12 +6,11 @@ height: var(--zen-toolbar-height);
|
|||||||
transition-delay: 0.05s;
|
transition-delay: 0.05s;
|
||||||
|
|
||||||
& > * {
|
& > * {
|
||||||
transition: transform 0.4s ease-out;
|
transition: transform 0.1s ease-out;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
|
&:not([zen-has-hover='true']):not([has-popup-menu]):not(:focus-within) {
|
||||||
transition-delay: 0.2s;
|
|
||||||
height: var(--zen-element-separation);
|
height: var(--zen-element-separation);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
|
@@ -573,9 +573,6 @@
|
|||||||
padding-top: var(--zen-element-separation);
|
padding-top: var(--zen-element-separation);
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
:root:has(&) #zen-sidebar-splitter {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
& #tabbrowser-arrowscrollbox-periphery {
|
& #tabbrowser-arrowscrollbox-periphery {
|
||||||
& > toolbarbutton {
|
& > toolbarbutton {
|
||||||
margin: 0 auto !important;
|
margin: 0 auto !important;
|
||||||
@@ -677,6 +674,10 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:root:not([zen-sidebar-expanded='true']) #zen-sidebar-splitter {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
/* Mark: Separator styling */
|
/* Mark: Separator styling */
|
||||||
#zen-sidebar-splitter {
|
#zen-sidebar-splitter {
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
@@ -808,7 +809,7 @@
|
|||||||
padding-inline-start: var(--zen-toolbox-padding);
|
padding-inline-start: var(--zen-toolbox-padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
#nav-bar:has(&) & {
|
#nav-bar & {
|
||||||
padding-inline-start: var(--toolbarbutton-outer-padding);
|
padding-inline-start: var(--toolbarbutton-outer-padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -106,10 +106,10 @@ var gZenCompactModeManager = {
|
|||||||
this._isAnimating = true;
|
this._isAnimating = true;
|
||||||
const sidebarWidth = this.sidebar.getBoundingClientRect().width;
|
const sidebarWidth = this.sidebar.getBoundingClientRect().width;
|
||||||
if (canHideSidebar && isCompactMode) {
|
if (canHideSidebar && isCompactMode) {
|
||||||
document.getElementById('browser').style.overflow = "hidden";
|
|
||||||
this.sidebar.style.position = "relative";
|
this.sidebar.style.position = "relative";
|
||||||
this.sidebar.style.transition = "margin .3s ease, transform .4s ease, opacity .3s ease";
|
this.sidebar.style.transition = "margin .3s ease, opacity .3s ease";
|
||||||
this.sidebar.style.left = "0";
|
this.sidebar.style.left = "0";
|
||||||
|
this.sidebar.style.setProperty("opacity", "1", "important");
|
||||||
if (!this.sidebarIsOnRight) {
|
if (!this.sidebarIsOnRight) {
|
||||||
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
|
this.sidebar.style.marginLeft = `${-1 * sidebarWidth}px`;
|
||||||
} else {
|
} else {
|
||||||
@@ -117,6 +117,8 @@ var gZenCompactModeManager = {
|
|||||||
}
|
}
|
||||||
this.sidebar.style.pointerEvents = "none";
|
this.sidebar.style.pointerEvents = "none";
|
||||||
|
|
||||||
|
window.requestAnimationFrame(() => {
|
||||||
|
this.sidebar.style.removeProperty("opacity");
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
window.requestAnimationFrame(() => {
|
window.requestAnimationFrame(() => {
|
||||||
this._isAnimating = false;
|
this._isAnimating = false;
|
||||||
@@ -130,7 +132,8 @@ var gZenCompactModeManager = {
|
|||||||
this.sidebar.style.removeProperty("left");
|
this.sidebar.style.removeProperty("left");
|
||||||
document.getElementById('browser').style.removeProperty("overflow");
|
document.getElementById('browser').style.removeProperty("overflow");
|
||||||
});
|
});
|
||||||
}, 400);
|
}, 500);
|
||||||
|
});
|
||||||
} else if (canHideSidebar && !isCompactMode) {
|
} else if (canHideSidebar && !isCompactMode) {
|
||||||
document.getElementById('browser').style.overflow = "hidden";
|
document.getElementById('browser').style.overflow = "hidden";
|
||||||
this.sidebar.style.position = "relative";
|
this.sidebar.style.position = "relative";
|
||||||
@@ -168,7 +171,7 @@ var gZenCompactModeManager = {
|
|||||||
|
|
||||||
document.getElementById('browser').style.removeProperty("overflow");
|
document.getElementById('browser').style.removeProperty("overflow");
|
||||||
});
|
});
|
||||||
}, 400);
|
}, 500);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user