From d7e56da00d16395d11cf9a9b322437ee3f1c4653 Mon Sep 17 00:00:00 2001 From: alstjr7375 Date: Mon, 18 Jul 2022 02:59:27 +0900 Subject: [PATCH] Add: Auto Hide - Tab Bar --- css/leptonChrome.css | 48 ++++++++++++++++++++++++++++++ src/autohide/_index.scss | 3 ++ src/autohide/_tabbar.scss | 61 +++++++++++++++++++++++++++++++++++++++ user.js | 3 +- 4 files changed, 114 insertions(+), 1 deletion(-) create mode 100644 src/autohide/_tabbar.scss diff --git a/css/leptonChrome.css b/css/leptonChrome.css index a4c1682..3651f27 100644 --- a/css/leptonChrome.css +++ b/css/leptonChrome.css @@ -5455,6 +5455,54 @@ z-index: 2; } } +@supports -moz-bool-pref("userChrome.autohide.tabbar") { + :root:not([customizing]) #navigator-toolbox { + position: relative; + z-index: 1; + } + + #navigator-toolbox:not(:hover) > #titlebar { + -moz-window-dragging: no-drag !important; + pointer-events: none; + } + + :root:not([customizing]) #navigator-toolbox:hover, + :root:not([customizing]) #titlebar { + margin-bottom: calc(0px - 2 * var(--tab-block-margin) - var(--tab-min-height)); + } + + #TabsToolbar:not([customizing]) { + opacity: 0; + } + + #navigator-toolbox:hover > #titlebar { + margin-bottom: 0px; + } + #navigator-toolbox:hover #TabsToolbar { + opacity: 1; + } + + @media (prefers-reduced-motion: no-preference) { + #navigator-toolbox, + #titlebar { + transition: margin-bottom 0.25s var(--animation-easing-function) 600ms; + } + + #TabsToolbar:not([customizing]) { + transition: opacity 0.25s var(--animation-easing-function) 600ms; + } + + #navigator-toolbox:hover { + transition-delay: 0s; + } + #navigator-toolbox:hover > #titlebar { + transition-delay: 0s; + } + #navigator-toolbox:hover #TabsToolbar { + transition-delay: 0s; + } + } +} @supports -moz-bool-pref("userChrome.autohide.navbar") { :root[sessionrestored] :where(#nav-bar, #PersonalToolbar, #tab-notification-deck, .global-notificationbox) { transform: translateY(var(--uc-navbar-hide-height)); diff --git a/src/autohide/_index.scss b/src/autohide/_index.scss index e59b95e..50de57d 100644 --- a/src/autohide/_index.scss +++ b/src/autohide/_index.scss @@ -3,6 +3,9 @@ } @import "common"; +@include Option("userChrome.autohide.tabbar") { + @import "tabbar"; +} @include Option("userChrome.autohide.navbar") { @import "navbar"; } diff --git a/src/autohide/_tabbar.scss b/src/autohide/_tabbar.scss new file mode 100644 index 0000000..a55060e --- /dev/null +++ b/src/autohide/_tabbar.scss @@ -0,0 +1,61 @@ +:root:not([customizing]) #navigator-toolbox { + position: relative; + z-index: 1; +} + +#navigator-toolbox:not(:hover) > #titlebar { + -moz-window-dragging: no-drag !important; + pointer-events: none +} + +:root:not([customizing]) #navigator-toolbox:hover, +:root:not([customizing]) #titlebar { + margin-bottom: calc(0px - 2 * var(--tab-block-margin) - var(--tab-min-height)); +} + +#TabsToolbar:not([customizing]) { + opacity: 0; +} + +#navigator-toolbox:hover { + > #titlebar { + margin-bottom: 0px; + } + #TabsToolbar { + opacity: 1; + } +} + +@include Animate { + #navigator-toolbox, + #titlebar { + transition: margin-bottom 0.25s var(--animation-easing-function) 600ms; + } + + #TabsToolbar:not([customizing]) { + transition: opacity 0.25s var(--animation-easing-function) 600ms; + } + + #navigator-toolbox:hover { + transition-delay: 0s; + + > #titlebar { + transition-delay: 0s; + } + + #TabsToolbar { + transition-delay: 0s; + } + } +} + +// /* These rules make sure that height of tabs toolbar doesn't exceed tab-min-height */ +// #tabbrowser-tabs:not([secondarytext-unsupported]) .tab-label-container{ +// max-height: var(--tab-min-height); +// } +// .tab-label { +// line-height: 20px !important; +// } +// :root[uidensity="compact"] .tab-label { +// line-height: 18px !important; +// } diff --git a/user.js b/user.js index 08e2d74..588804e 100644 --- a/user.js +++ b/user.js @@ -70,8 +70,9 @@ user_pref("userChrome.tab.bottom_rounded_corner", true); // user_pref("userChrome.theme.proton_color.dark_blue_accent", true); -// user_pref("userChrome.autohide.bookmarkbar", true); +// user_pref("userChrome.autohide.tabbar", true); // user_pref("userChrome.autohide.navbar", true); +// user_pref("userChrome.autohide.bookmarkbar", true); // user_pref("userChrome.autohide.sidebar", true); // user_pref("userChrome.autohide.forward_button", true);