From 6f24a1443faf8b012e850b97a48dfc11c5c2a527 Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Sat, 15 May 2021 12:13:32 +0300 Subject: [PATCH] handle fullscreen mode better --- chrome/hide_tabs_toolbar.css | 1 + chrome/hide_tabs_toolbar_osx.css | 2 +- chrome/hide_tabs_with_one_tab.css | 3 ++- chrome/hide_tabs_with_one_tab_w_window_controls.css | 6 ++++++ chrome/tabs_on_bottom_menubar_on_top_patch.css | 4 ++-- chrome/window_control_placeholder_support.css | 10 +++++++++- 6 files changed, 21 insertions(+), 5 deletions(-) diff --git a/chrome/hide_tabs_toolbar.css b/chrome/hide_tabs_toolbar.css index 06ca022..ac3fb88 100644 --- a/chrome/hide_tabs_toolbar.css +++ b/chrome/hide_tabs_toolbar.css @@ -15,6 +15,7 @@ Window controls will be all wrong without it :root:not([uidensity="compact"]){--uc-toolbar-height: 38px} #TabsToolbar{ visibility: collapse !important } +:root[sizemode="fullscreen"] #TabsToolbar > #window-controls{ visibility: visible !important; z-index: 2 } :root:not([inFullscreen]) #nav-bar{ margin-top: calc(0px - var(--uc-toolbar-height)); diff --git a/chrome/hide_tabs_toolbar_osx.css b/chrome/hide_tabs_toolbar_osx.css index 764bb57..7607710 100644 --- a/chrome/hide_tabs_toolbar_osx.css +++ b/chrome/hide_tabs_toolbar_osx.css @@ -13,7 +13,7 @@ Window controls will be all wrong without it :root:not([uidensity="compact"]){ --uc-toolbar-height: 34px } #TabsToolbar > *{ visibility: collapse !important } - +:root[sizemode="fullscreen"] #TabsToolbar > #window-controls{ visibility: visible !important; z-index: 2 } #TabsToolbar > .titlebar-buttonbox-container{ visibility: visible !important; height:var(--uc-toolbar-height) !important; diff --git a/chrome/hide_tabs_with_one_tab.css b/chrome/hide_tabs_with_one_tab.css index bbe37fa..fd07a8e 100644 --- a/chrome/hide_tabs_with_one_tab.css +++ b/chrome/hide_tabs_with_one_tab.css @@ -4,6 +4,7 @@ See the above repository for updates as well as full license text. */ /* Makes tabs toolbar items zero-height initially and sets enlarge them to fill up space equal to tab-min-height set on tabs. Optionally use privatemode_indicator_as_menu_button.css to replace main menu icon with private browsing indicator while tabs are hidden. */ /* Firefox 65+ only */ + :root[sizemode="normal"] #nav-bar{ --uc-window-drag-space-width: 20px } #titlebar{ -moz-appearance: none !important; } @@ -53,6 +54,6 @@ See the above repository for updates as well as full license text. */ :root[tabsintitlebar] #toolbar-menubar[autohide="true"][inactive]{ transition: height 0ms steps(1) 80ms; } -#nav-bar{ +:where(#nav-bar){ border-inline: var(--uc-window-drag-space-width) solid var(--toolbar-bgcolor); } diff --git a/chrome/hide_tabs_with_one_tab_w_window_controls.css b/chrome/hide_tabs_with_one_tab_w_window_controls.css index cb01d65..38639cb 100644 --- a/chrome/hide_tabs_with_one_tab_w_window_controls.css +++ b/chrome/hide_tabs_with_one_tab_w_window_controls.css @@ -62,3 +62,9 @@ Window controls will be all wrong without it } :root:not([customizing]) #toolbar-menubar[autohide][inactive] > #menubar-items{ pointer-events: none; opacity: 0 } + +:root[sizemode="fullscreen"] .titlebar-buttonbox-container{ display: none !important; } +:root[sizemode="fullscreen"] #TabsToolbar > #window-controls{ + z-index: 2; + top: calc(var(--tab-min-height) + 2 * var(--proton-tab-block-margin,0px)); +} \ No newline at end of file diff --git a/chrome/tabs_on_bottom_menubar_on_top_patch.css b/chrome/tabs_on_bottom_menubar_on_top_patch.css index 10baec3..7203c74 100644 --- a/chrome/tabs_on_bottom_menubar_on_top_patch.css +++ b/chrome/tabs_on_bottom_menubar_on_top_patch.css @@ -4,10 +4,10 @@ See the above repository for updates as well as full license text. */ /* Menubar on top patch - use with tabs_on_bottom.css */ /* Only really useful if menubar is ALWAYS visible */ -:root{ --uc-window-control-width: 0px !important } +:root:not([sizemode="fullscreen"]){ --uc-window-control-width: 0px !important } #navigator-toolbox{ padding-top: calc(29px + var(--uc-titlebar-padding,0px)) !important } - +:root[sizemode="fullscreen"] #navigator-toolbox{ padding-top: 0px !important; } #toolbar-menubar{ position: fixed; display: flex; diff --git a/chrome/window_control_placeholder_support.css b/chrome/window_control_placeholder_support.css index 79d4b97..0d0eeb5 100644 --- a/chrome/window_control_placeholder_support.css +++ b/chrome/window_control_placeholder_support.css @@ -14,7 +14,15 @@ See the above repository for updates as well as full license text. */ --uc-window-control-width: 138px; /* Space reserved for window controls */ --uc-window-drag-space-width: 24px; /* Extra space reserved on both sides of the nav-bar to be able to drag the window */ } - +:root[sizemode="fullscreen"] .titlebar-buttonbox-container{ display: none !important } +:root[sizemode="fullscreen"] #window-controls{ + position: fixed; + display: flex; + top: 0; + right:0; + height: 40px; +} +:root[uidensity="compact"][sizemode="fullscreen"] #window-controls{ height: 32px } #nav-bar{ border-inline: var(--uc-window-drag-space-width,0px) solid var(--toolbar-bgcolor); border-inline-style: solid !important;