From d08d7791fa154c4ff4e374b87ecde16a1a4d7e17 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Mon, 2 Sep 2024 16:06:53 +0300 Subject: [PATCH] toggle tabs toolbar with alt: Make Alt only show tabs toolbar This is pretty much complete rewrite, Alt now only show tabs toolbar, but when you press Alt again while also hovering tabs toolbar, then menubar items will be shown and window controls likewise. There's a weird behavior, some 1px slice that hides tabs toolbar when cursor is moved from tabs to window controls, but doesn't trigger from other direction mysteriously. But window controls can be accessed when cursor is already where window controls would appear when Alt is pressed the second time. --- chrome/toggle_tabs_toolbar_with_alt.css | 38 ++++++++++++++++--------- 1 file changed, 25 insertions(+), 13 deletions(-) diff --git a/chrome/toggle_tabs_toolbar_with_alt.css b/chrome/toggle_tabs_toolbar_with_alt.css index 3dc37c7..a752cdf 100644 --- a/chrome/toggle_tabs_toolbar_with_alt.css +++ b/chrome/toggle_tabs_toolbar_with_alt.css @@ -1,18 +1,30 @@ /* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/toggle_tabs_toolbar_with_alt.css made available under Mozilla Public License v. 2.0 See the above repository for updates as well as full license text. */ -/* Show tabs toolbar with Alt-key. Menubar must be disabled for this to work */ +/* Show tabs toolbar with Alt-key. Menubar must be disabled for this to work. + * To show window controls and/or menubar hit Alt again while cursor is over tabs toolbar */ -#titlebar { -moz-appearance: none !important } -:root[tabsintitlebar][sizemode="maximized"]{ padding-top: 8px !important; } -#titlebar:not(:hover) > #toolbar-menubar[autohide="true"][inactive] + #TabsToolbar { visibility: collapse } - -/* Behavior 1 - Alt-key toggles menubar as normal */ -#titlebar:hover > #toolbar-menubar[autohide="true"]{ height: calc(var(--tab-min-height) + var(--space-above-tabbar) - var(--tabs-navbar-shadow-size)) !important; } - -/* Behavior 2 - Alt-key only shows tabs toolbar */ -/* To show window controls, hit Alt again while cursor is over tabs toolbar */ -/* +:where(#titlebar:not(:hover) > #toolbar-menubar[autohide="true"][inactive]) + #TabsToolbar { + visibility: collapse; +} #toolbar-menubar[autohide]:not([inactive]), -#toolbar-menubar[autohide="true"]:not([inactive]) + #TabsToolbar > .titlebar-buttonbox-container{ visibility: collapse !important } -*/ \ No newline at end of file +#toolbar-menubar[autohide="true"]:not([inactive],:hover) + #TabsToolbar > .titlebar-buttonbox-container{ + visibility: collapse !important; +} +#menubar-items:has([_moz-menuactive][open="true"]), +#toolbar-menubar[autohide]:hover > #menubar-items, +:root:not([sizemode="fullscreen"]) #titlebar:hover #toolbar-menubar[autohide][inactive] > #menubar-items{ + visibility: visible; + position: absolute; + z-index: 1; + height: calc(var(--tab-min-height) + 2 * var(--tab-block-margin)); + background-color: -moz-dialog; + align-items: stretch; +} +#main-window[sizemode="fullscreen"] #TabsToolbar{ + visibility: visible !important; +} +#main-window[sizemode="fullscreen"] #toolbar-menubar > #menubar-items{ + visibility: collapse; +} +#main-menubar{ height: 100%; }