From 9fe466140a46d1ebccc610ae3479d37d5b2f214a Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Sun, 22 Oct 2023 14:19:16 +0300 Subject: [PATCH] Further improve selected_tab_as_urlbar and selected_tab_to_focus ulrbar --- chrome/click_selected_tab_to_focus_urlbar.css | 26 +++++++++++-- chrome/selected_tab_as_urlbar.css | 37 +++++++++++++++---- 2 files changed, 52 insertions(+), 11 deletions(-) diff --git a/chrome/click_selected_tab_to_focus_urlbar.css b/chrome/click_selected_tab_to_focus_urlbar.css index c568e17..8dbb708 100644 --- a/chrome/click_selected_tab_to_focus_urlbar.css +++ b/chrome/click_selected_tab_to_focus_urlbar.css @@ -12,6 +12,22 @@ See the above repository for updates as well as full license text. */ .tabbrowser-tab:not([pinned])[selected]{ pointer-events: none } +:root{ + --uc-window-control-width: 138px; + --uc-buttons-width: 116px; + --uc-window-drag-space-width: 40px; + --uc-menubar-height: 0px; +} +@media (-moz-platform: windows), + (-moz-platform: linux){ + :root:is([sizemode="maximized"],[sizemode="fullscreen"]){ + --uc-window-drag-space-width: 0px; + } + #titlebar:has(> [autohide="false"]) + #nav-bar{ + --uc-window-drag-space-width: 0px; + --uc-menubar-height: 28px; + } +} /* Add back pointer-events to several elements so UI remains usable */ /* The selected tab can be clicked normally from the icon */ #TabsToolbar toolbarbutton, @@ -21,19 +37,21 @@ See the above repository for updates as well as full license text. */ .tab-icon-stack{ pointer-events: auto } - /* Invisible capture box behind tabs*/ :root:not([customizing]) #urlbar-input-container::before{ position: fixed; display: block; left: 0; - width: calc(100vw - 138px); + top: var(--uc-menubar-height); + width: var(--uc-buttons-width); height: calc(var(--tab-min-height) + 2*var(--tab-block-margin)); content: ""; pointer-events: auto; } -:root[sizemode="normal"]:not([customizing]) #urlbar-input-container::before{ left: 40px; width: calc(100vw - 138px - 80px) } - +:root[tabsintitlebar]:not([customizing]) #urlbar-input-container::before{ + left: var(--uc-window-drag-space-width); + width: calc(100vw - var(--uc-window-control-width) - var(--uc-buttons-width) - 2 * var(--uc-window-drag-space-width)); +} #urlbar-input-container:focus-within::before{ display: none !important; } /* Make tabs appear over the invisible box */ diff --git a/chrome/selected_tab_as_urlbar.css b/chrome/selected_tab_as_urlbar.css index daecd03..be45b36 100644 --- a/chrome/selected_tab_as_urlbar.css +++ b/chrome/selected_tab_as_urlbar.css @@ -14,8 +14,18 @@ See the above repository for updates as well as full license text. */ #PanelUI-button, #nav-bar-overflow-button{ z-index: 2; position: relative } -:root[sizemode="normal"] #urlbar-container{ margin-inline: 40px !important; } - +#urlbar-input-container{ + width: calc(100vw - var(--uc-window-control-width) - var(--uc-buttons-width) - 2 * var(--uc-window-drag-space-width) - 76px) !important; + left: calc(76px + var(--uc-window-drag-space-width)) !important; + pointer-events: none; + overflow: visible !important; +} +:root:not([customizing]) #urlbar-input-container::before{ + position: absolute; + left: 0; + top: 0 !important; + height: var(--urlbar-container-height); +} #urlbar-input-container > :not(.urlbar-input-box){ opacity: 0 } #urlbar-background{ @@ -24,7 +34,20 @@ See the above repository for updates as well as full license text. */ box-shadow: none !important; outline: none !important; } -#urlbar-container{ position: static !important; } +#urlbar{pointer-events: none !important;} +#urlbar-container{ + position: static !important; + margin-left: var(--uc-window-control-width) !important; +} +#remote-control-box, +#urlbar-search-button{ + display: none; +} +#tracking-protection-icon-container, +#identity-box{ + max-width: 0.1px; + padding-inline: 0 !important; +} .urlbarView{ background: var(--toolbar-field-focus-background-color); border: 1px solid var(--toolbar-field-focus-border-color) !important; @@ -58,7 +81,7 @@ See the above repository for updates as well as full license text. */ /* Oh and! also hide other buttons from the nav-bar because why not */ :root:not([customizing]) #nav-bar-customization-target > :not(#urlbar-container){ visibility: collapse } #TabsToolbar > .toolbar-items{ - margin-right: 40px !important; + margin-right: 112px !important; /* This is space on right side for 3 buttons, menu, overflow and addons */ margin-left: 80px !important; } #unified-extensions-button{ @@ -73,8 +96,8 @@ See the above repository for updates as well as full license text. */ /* By default this style moves your back and forward buttons to the left edge of the navbar and adds a placeholder space for them. Set the following pref to false to disable that behavior */ @media (-moz-bool-pref: "userchrome.selected-tab-as-urlbar.nav-buttons-space.disabled"){ - #TabsToolbar > .toolbar-items{ margin-left: 0px } - #nav-bar-customization-target{ margin-left: 0px } + #TabsToolbar > .toolbar-items{ margin-left: 0px !important; } + #nav-bar-customization-target{ margin-left: 0px !important; } #back-button, #forward-button{ order: auto; z-index: auto; @@ -95,5 +118,5 @@ See the above repository for updates as well as full license text. */ background-color: transparent !important; } #titlebar:has(> [autohide="true"]) + #nav-bar{ - padding-right: 138px; + padding-right: calc(138px + 40px); } \ No newline at end of file