Clean: Menubar - Height provide by autohide

This commit is contained in:
alstjr7375 2022-11-20 00:23:31 +09:00
parent eedc04dd75
commit 050f06d867
4 changed files with 90 additions and 74 deletions

View file

@ -3,7 +3,7 @@
--uc-autohide-toolbar-delay: 600ms;
}
@include Option("userChrome.autohide.tabbar", "userChrome.autohide.navbar", "userChrome.autohide.bookmarkbar", "userChrome.tabbar.one_liner", "userChrome.hidden.tabbar", "userChrome.navbar.as_sidebar") {
@include Option("userChrome.autohide.tabbar", "userChrome.autohide.navbar", "userChrome.autohide.bookmarkbar", "userChrome.tabbar.one_liner", "userChrome.tabbar.on_bottom.menubar_on_top", "userChrome.hidden.tabbar", "userChrome.navbar.as_sidebar") {
:root {
--uc-tabbar-height: var(--uc-tabbar-height-default);
--uc-tabbar-height-default: var(--tab-min-height); // calc((var(--tab-block-margin) * 2) + var(--tab-min-height));
@ -22,9 +22,12 @@
// https://github.com/mozilla/gecko-dev/blob/92d3050ecbbdd077ffa4cb78e0dffc4bd5021109/browser/themes/linux/browser.css#L327
// https://github.com/mozilla/gecko-dev/blob/92d3050ecbbdd077ffa4cb78e0dffc4bd5021109/browser/themes/windows/browser-aero.css#L14
// https://github.com/mozilla/gecko-dev/blob/92d3050ecbbdd077ffa4cb78e0dffc4bd5021109/browser/themes/windows/browser.css#L65
$_menubarPadding: 2px; // menubar padding block 1px
$_menubarPadding: 1px * 2; // menubar padding block 1px
$_menubarHeightDefault: 1rem + 0.3rem * 2; // text 1rem, menu padding 0.3em
--uc-titlebar-buttonbox-height: #{ 32px + $_menubarPadding };
--uc-menubar-height: 0px;
--uc-menubar-height-default: #{ calc($_menubarHeightDefault + $_menubarPadding) };
--uc-menubar-inner-height: #{ calc($_menubarHeightDefault - $_menubarPadding) };
@include Option("userChrome.hidden.tabbar") {
@include OneLinerNavbarContent() {
@ -37,11 +40,11 @@
}
@include Has {
:root {
&:not([tabsintitlebar]):has(#toolbar-menubar) #nav-bar {
--uc-menubar-height: #{ 1rem + 0.3rem * 2 }; // text 1rem, menu padding 0.3em
&:not([tabsintitlebar]):has(#toolbar-menubar) {
--uc-menubar-height: var(--uc-menubar-height-default); // text 1rem, menu padding 0.3em
}
&[tabsintitlebar]:has(#toolbar-menubar[autohide="true"]) #nav-bar {
&[tabsintitlebar]:has(#toolbar-menubar[autohide="true"]) {
@include OS($linux) {
--uc-menubar-height: calc(var(--tab-min-height) + 2 * var(--tab-block-margin));
}
@ -52,13 +55,13 @@
--uc-menubar-height: calc(var(--tab-min-height) + var(--tab-block-margin));
}
}
&[tabsintitlebar]:has(#toolbar-menubar[autohide="false"]) #nav-bar {
&[tabsintitlebar]:has(#toolbar-menubar[autohide="false"]) {
--uc-menubar-height: var(--uc-titlebar-buttonbox-height);
}
&:not([tabsintitlebar]),
&[tabsintitlebar] {
&:has(#toolbar-menubar[autohide="true"][inactive="true"]) #nav-bar {
&:has(#toolbar-menubar[autohide="true"][inactive="true"]) {
--uc-menubar-height: 0px;
}
}

View file

@ -60,17 +60,6 @@ See the above repository for updates as well as full license text. */
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/tabs_on_bottom_menubar_on_top_patch.css made available under Mozilla Public License v. 2.0
See the above repository for updates as well as full license text. */
:root {
/* height if native titlebar is enabled, assumes empty menubar */
--uc-menubar-height: 20px;
--uc-menubar-padding: 1px; /* FF's menubar padding */
--uc-menubar-container-height: calc(var(--uc-menubar-height) - (2 * var(--uc-menubar-padding)));
}
:root[tabsintitlebar] {
/* height when native titlebar is disabled, more roomy so can fit buttons etc. */
--uc-menubar-height: 30px;
}
/* Menubar on top patch - use with tabs_on_bottom.css */
/* Only really useful if menubar is ALWAYS visible */
:root:not([sizemode="fullscreen"]) {
@ -117,10 +106,6 @@ See the above repository for updates as well as full license text. */
--toolbarbutton-inner-padding: 3px;
}
#toolbar-menubar[autohide="true"] > .titlebar-buttonbox-container,
#TabsToolbar > .titlebar-buttonbox-container {
height: var(--uc-menubar-container-height);
}
:root:not([chromehidden~="menubar"], [sizemode="fullscreen"]) #toolbar-menubar:not([autohide="true"]) + #TabsToolbar > .titlebar-buttonbox-container{
visibility: collapse !important;
}

View file

@ -8,7 +8,13 @@ See the above repository for updates as well as full license text. */
}
#navigator-toolbox {
padding-top: calc(var(--uc-menubar-height, 0px) + var(--uc-titlebar-padding)) !important;
padding-top: var(--uc-titlebar-padding) !important;
@include Option("userChrome.tabbar.on_bottom") {
@include Option("userChrome.tabbar.on_bottom.menubar_on_top") {
padding-top: calc(max(var(--uc-menubar-height), var(--uc-menubar-height-default)) + var(--uc-titlebar-padding)) !important;
}
}
}
#toolbar-menubar[autohide="true"] > .titlebar-buttonbox-container,