mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-06 09:56:36 +00:00
fix: refine navbar visibility logic for compact mode and window button placement
This commit is contained in:
@@ -295,7 +295,12 @@ var gZenVerticalTabsManager = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const appContentNavbarContaienr = document.getElementById('zen-appcontent-navbar-container');
|
const appContentNavbarContaienr = document.getElementById('zen-appcontent-navbar-container');
|
||||||
if ((!isRightSide && this.isWindowsStyledButtons) || (isRightSide && !this.isWindowsStyledButtons) || isCompactMode) {
|
if ((!isRightSide && this.isWindowsStyledButtons) || (isRightSide && !this.isWindowsStyledButtons)
|
||||||
|
|| (
|
||||||
|
isCompactMode && isSingleToolbar && !(
|
||||||
|
(!this.isWindowsStyledButtons && !isRightSide)
|
||||||
|
)
|
||||||
|
)) {
|
||||||
appContentNavbarContaienr.setAttribute('should-hide', 'true');
|
appContentNavbarContaienr.setAttribute('should-hide', 'true');
|
||||||
} else {
|
} else {
|
||||||
appContentNavbarContaienr.removeAttribute('should-hide');
|
appContentNavbarContaienr.removeAttribute('should-hide');
|
||||||
@@ -335,7 +340,7 @@ var gZenVerticalTabsManager = {
|
|||||||
buttonsTarget.prepend(document.getElementById('unified-extensions-button'));
|
buttonsTarget.prepend(document.getElementById('unified-extensions-button'));
|
||||||
buttonsTarget.prepend(document.getElementById('PanelUI-button'));
|
buttonsTarget.prepend(document.getElementById('PanelUI-button'));
|
||||||
if (this.isWindowsStyledButtons && !doNotChangeWindowButtons) {
|
if (this.isWindowsStyledButtons && !doNotChangeWindowButtons) {
|
||||||
document.getElementById('zen-appcontent-navbar-container').append(windowButtons);
|
appContentNavbarContaienr.append(windowButtons);
|
||||||
}
|
}
|
||||||
if (isCompactMode) {
|
if (isCompactMode) {
|
||||||
titlebar.prepend(navBar);
|
titlebar.prepend(navBar);
|
||||||
@@ -379,19 +384,23 @@ var gZenVerticalTabsManager = {
|
|||||||
} else if (!isSingleToolbar && !isCompactMode) {
|
} else if (!isSingleToolbar && !isCompactMode) {
|
||||||
if (this.isWindowsStyledButtons) {
|
if (this.isWindowsStyledButtons) {
|
||||||
if (isRightSide) {
|
if (isRightSide) {
|
||||||
document.getElementById('zen-appcontent-navbar-container').append(windowButtons);
|
appContentNavbarContaienr.append(windowButtons);
|
||||||
} else {
|
} else {
|
||||||
navBar.append(windowButtons);
|
navBar.append(windowButtons);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (isRightSide) {
|
if (isRightSide) {
|
||||||
document.getElementById('zen-appcontent-navbar-container').appendChild(windowButtons);
|
appContentNavbarContaienr.appendChild(windowButtons);
|
||||||
} else {
|
} else {
|
||||||
topButtons.prepend(windowButtons);
|
topButtons.prepend(windowButtons);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!isSingleToolbar && isCompactMode) {
|
} else if (!isSingleToolbar && isCompactMode) {
|
||||||
navBar.appendChild(windowButtons);
|
navBar.appendChild(windowButtons);
|
||||||
|
} else if (isSingleToolbar && isCompactMode) {
|
||||||
|
if (!isRightSide && !this.isWindowsStyledButtons) {
|
||||||
|
topButtons.prepend(windowButtons);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gZenCompactModeManager.updateCompactModeContext(isSingleToolbar);
|
gZenCompactModeManager.updateCompactModeContext(isSingleToolbar);
|
||||||
|
Reference in New Issue
Block a user