From 890a03f4ffd8ba7833a42aaa09d7b40565c04dd4 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Mon, 9 Dec 2024 11:53:29 +0200 Subject: [PATCH] autohiding toolbars: exclude tab-preview-panel from keeping toolbar open Tab preview panel can sometimes cause what is possibly style invalidation problem where the panel would jump around and even be outside the window. This is especially likely to happen with autohide_main_toolbar when tabs are overflowing. --- chrome/autohide_bookmarks_and_main_toolbars.css | 4 ++-- chrome/autohide_main_toolbar.css | 4 ++-- chrome/autohide_toolbox.css | 4 ++-- chrome/overlay_fullscreen_toolbars.css | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/chrome/autohide_bookmarks_and_main_toolbars.css b/chrome/autohide_bookmarks_and_main_toolbars.css index 26c2c3f..d23d141 100644 --- a/chrome/autohide_bookmarks_and_main_toolbars.css +++ b/chrome/autohide_bookmarks_and_main_toolbars.css @@ -66,7 +66,7 @@ See the above repository for updates as well as full license text. */ transform-origin: 0px calc((var(--urlbar-container-height) - var(--urlbar-height)) / 2); transform: rotateX(89.5deg); } -#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ toolbox #urlbar[popover], +#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox #urlbar[popover], #navigator-toolbox:is(:hover,:focus-within) #urlbar[popover], #urlbar-container > #urlbar[popover]:is([focused],[open]){ opacity: 1; @@ -100,7 +100,7 @@ See the above repository for updates as well as full license text. */ .tabbrowser-tab[selected]{ z-index: 3 !important; } /* Show when cursor is over main menu popup - this requires :has selector support */ -#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ toolbox > .browser-toolbar{ +#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox > .browser-toolbar{ transition-delay: 100ms !important; transform: rotateX(0); } diff --git a/chrome/autohide_main_toolbar.css b/chrome/autohide_main_toolbar.css index ec5d334..a07b285 100644 --- a/chrome/autohide_main_toolbar.css +++ b/chrome/autohide_main_toolbar.css @@ -57,7 +57,7 @@ See the above repository for updates as well as full license text. */ transition: transform var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay), opacity var(--uc-autohide-toolbar-duration) ease var(--uc-autohide-toolbar-delay); transform: translateY(var(--uc-navbar-transform)); } -#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ toolbox #urlbar[popover], +#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox #urlbar[popover], .browser-titlebar:is(:hover,:focus-within) ~ #nav-bar #urlbar[popover], #nav-bar:is(:hover,:focus-within) #urlbar[popover], #urlbar-container > #urlbar[popover]:is([focused],[open]){ @@ -70,7 +70,7 @@ See the above repository for updates as well as full license text. */ transition-duration: 100ms; /* Faster when focused */ } /* This ruleset is separate, because not having :has support breaks other selectors as well */ -#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ #navigator-toolbox > .browser-toolbar{ +#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ #navigator-toolbox > .browser-toolbar{ transition-delay: 33ms !important; transform: translateY(0); opacity: 1; diff --git a/chrome/autohide_toolbox.css b/chrome/autohide_toolbox.css index 48e89c3..8239229 100644 --- a/chrome/autohide_toolbox.css +++ b/chrome/autohide_toolbox.css @@ -41,7 +41,7 @@ See the above repository for updates as well as full license text. */ transform-origin: 0px calc(0px - var(--tab-min-height) - var(--tab-block-margin) * 2); transform: rotateX(89.9deg); } -#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ toolbox #urlbar[popover], +#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox #urlbar[popover], #navigator-toolbox:is(:hover,:focus-within) #urlbar[popover], #urlbar-container > #urlbar[popover]:is([focused],[open]){ pointer-events: auto; @@ -49,7 +49,7 @@ See the above repository for updates as well as full license text. */ transition-delay: 33ms; transform: rotateX(0deg); } -#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ toolbox, +#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox, #navigator-toolbox:has(#urlbar:is([open],[focus-within])), #navigator-toolbox:hover, #navigator-toolbox:focus-within{ diff --git a/chrome/overlay_fullscreen_toolbars.css b/chrome/overlay_fullscreen_toolbars.css index 2160835..f7b8478 100644 --- a/chrome/overlay_fullscreen_toolbars.css +++ b/chrome/overlay_fullscreen_toolbars.css @@ -26,11 +26,11 @@ See the above repository for updates as well as full license text. */ transform: translateY(-100%); } #navigator-toolbox:is(:hover,:focus-within,[style=""]), - #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ #navigator-toolbox{ + #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ #navigator-toolbox{ transition-delay: 0ms !important; transform: translateY(0); } - #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts)) ~ toolbox #urlbar[popover], + #mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox #urlbar[popover], #navigator-toolbox:is(:hover,:focus-within,[style=""]) #urlbar[popover], #urlbar-container > #urlbar[popover]:is([focused],[open]){ pointer-events: auto;