From 1443d8e55922b62e890891bc41c80681b329d278 Mon Sep 17 00:00:00 2001 From: "mr. m" <91018726+mr-cheffy@users.noreply.github.com> Date: Wed, 15 Oct 2025 21:13:57 +0200 Subject: [PATCH] fix: Fixed where top buttons should stay when entering compact mode, p=#10829, c=common, compact-mode, tabs, workspaces --- src/zen/common/ZenUIManager.mjs | 7 +++++-- src/zen/common/styles/zen-browser-container.css | 2 +- src/zen/compact-mode/ZenCompactMode.mjs | 3 ++- src/zen/compact-mode/toolbar.inc.css | 6 ++---- .../tabs/zen-tabs/vertical-tabs-topbar.inc.css | 2 +- src/zen/tabs/zen-tabs/vertical-tabs.css | 16 ++++++++-------- src/zen/workspaces/zen-workspaces.css | 2 +- 7 files changed, 20 insertions(+), 18 deletions(-) diff --git a/src/zen/common/ZenUIManager.mjs b/src/zen/common/ZenUIManager.mjs index a1726711a..aedc9f29c 100644 --- a/src/zen/common/ZenUIManager.mjs +++ b/src/zen/common/ZenUIManager.mjs @@ -78,7 +78,7 @@ var gZenUIManager = { _initBookmarkCollapseListener() { const toolbar = document.getElementById('PersonalToolbar'); - if (toolbar.getAttribute('collapsed') !== 'true') { + if (!toolbar.hasAttribute('collapsed')) { // Set it initially if bookmarks toolbar is visible, customizable UI // is ran before this function. document.documentElement.setAttribute('zen-has-bookmarks', 'true'); @@ -1091,7 +1091,10 @@ var gZenVerticalTabsManager = { ((!this.isWindowsStyledButtons && !isRightSide) || (this.isWindowsStyledButtons && isRightSide)); if ( - (!isSingleToolbar && isCompactMode && !captionsShouldStayOnSidebar) || + (!isSingleToolbar && + isCompactMode && + !captionsShouldStayOnSidebar && + this.isWindowsStyledButtons === isRightSide) || !isSidebarExpanded ) { navBar.prepend(topButtons); diff --git a/src/zen/common/styles/zen-browser-container.css b/src/zen/common/styles/zen-browser-container.css index de25bf38e..536c11ac6 100644 --- a/src/zen/common/styles/zen-browser-container.css +++ b/src/zen/common/styles/zen-browser-container.css @@ -45,7 +45,7 @@ @media not ((-moz-pref('zen.view.experimental-no-window-controls') or (not -moz-pref('zen.view.hide-window-controls'))) and -moz-pref('zen.view.use-single-toolbar')) { .browserSidebarContainer:is(.deck-selected, [zen-split='true']) .browserContainer { - transition: margin 0.15s ease; + transition: margin 0.15s ease-in-out; :root[zen-single-toolbar='true'] & { transition-delay: 0.2s; diff --git a/src/zen/compact-mode/ZenCompactMode.mjs b/src/zen/compact-mode/ZenCompactMode.mjs index 8dfd8365d..83f8303be 100644 --- a/src/zen/compact-mode/ZenCompactMode.mjs +++ b/src/zen/compact-mode/ZenCompactMode.mjs @@ -570,7 +570,8 @@ var gZenCompactModeManager = { document.documentElement.hasAttribute('zen-has-bookmarks'))) || (this.preference && Services.prefs.getBoolPref('zen.view.compact.hide-toolbar') && - !gZenVerticalTabsManager._hasSetSingleToolbar)) + !gZenVerticalTabsManager._hasSetSingleToolbar && + !gURLBar.hasAttribute('breakout-extend'))) ) { gBrowser.tabpanels.setAttribute('has-toolbar-hovered', 'true'); } diff --git a/src/zen/compact-mode/toolbar.inc.css b/src/zen/compact-mode/toolbar.inc.css index 166da1039..5c7e1ecce 100644 --- a/src/zen/compact-mode/toolbar.inc.css +++ b/src/zen/compact-mode/toolbar.inc.css @@ -23,7 +23,7 @@ & .zen-toolbar-background { display: flex; } - transition: height 0.15s ease; + transition: height 0.15s ease-in-out; height: calc(var(--zen-element-separation) + 0.1px); overflow: clip; @@ -55,9 +55,7 @@ & #zen-appcontent-navbar-wrapper[has-popup-menu], & #zen-appcontent-navbar-wrapper:has( - *:is([panelopen='true'], [open='true'], #urlbar:focus-within, [breakout-extend='true']):not( - #urlbar[zen-floating-urlbar='true'] - ):not(.zen-compact-mode-ignore) + *:is([panelopen='true'], [open='true'], #urlbar:focus-within, [breakout-extend='true']):not(.zen-compact-mode-ignore) ) { height: var(--zen-toolbar-height-with-bookmarks); diff --git a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css index f66ee357b..cf6994743 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs-topbar.inc.css @@ -12,7 +12,7 @@ z-index: 1; } @media -moz-pref('zen.view.hide-window-controls') { - transition: height 0.15s ease, opacity 0.15s ease; + transition: height 0.15s ease-in-out, opacity 0.15s ease-in-out; will-change: height, opacity; transition-delay: 0.2s; overflow: clip; diff --git a/src/zen/tabs/zen-tabs/vertical-tabs.css b/src/zen/tabs/zen-tabs/vertical-tabs.css index 8be3fe996..ec5943370 100644 --- a/src/zen/tabs/zen-tabs/vertical-tabs.css +++ b/src/zen/tabs/zen-tabs/vertical-tabs.css @@ -29,6 +29,14 @@ /* ========================================================================== Single Toolbar Mode Specific Styles (`zen-single-toolbar='true'`) ========================================================================== */ +@media (-moz-platform: macos) and (not -moz-pref('zen.view.mac.show-three-dot-menu')) { + &:not([customizing]) #PanelUI-button:not([open]):not([panelopen]) { + position: absolute; + opacity: 0; + pointer-events: none; + } +} + :root[zen-single-toolbar='true'] { --zen-toolbar-height: 32px; @@ -37,14 +45,6 @@ height: var(--zen-toolbar-height); } - @media (-moz-platform: macos) and (not -moz-pref('zen.view.mac.show-three-dot-menu')) { - &:not([customizing]) #PanelUI-button:not([open]):not([panelopen]) { - position: absolute; - opacity: 0; - pointer-events: none; - } - } - & #zen-sidebar-top-buttons-separator { width: 100%; } diff --git a/src/zen/workspaces/zen-workspaces.css b/src/zen/workspaces/zen-workspaces.css index d38f0fab6..eb1044835 100644 --- a/src/zen/workspaces/zen-workspaces.css +++ b/src/zen/workspaces/zen-workspaces.css @@ -165,7 +165,7 @@ max-width: 100%; width: 100%; font-size: small; - padding-right: 10px; + padding-right: 12px; -moz-window-dragging: no-drag; &::before {