From da6df22d8b4a4c1da4b148a3afd15f36e3d083fb Mon Sep 17 00:00:00 2001 From: MrOtherGuy Date: Wed, 12 Jun 2019 13:33:11 +0300 Subject: [PATCH] Make toolbox margins OS scaling dependent --- chrome/autohide_toolbox.css | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/chrome/autohide_toolbox.css b/chrome/autohide_toolbox.css index 26c0f23..3d252ca 100644 --- a/chrome/autohide_toolbox.css +++ b/chrome/autohide_toolbox.css @@ -1,7 +1,18 @@ /* Hide the whole toolbar area unless urlbar is focused or cursor is over the toolbar */ /* Dimensions on non-Win10 OS probably needs to be adjusted */ -:root[sizemode="maximized"]:not([inDOMFullscreen]){ margin-top: 10px } +:root{ --uc-titlebar-scale-factor: 0px } +@media screen and (min-resolution: 1.25dppx){ + :root{ --uc-titlebar-scale-factor: 1px } +} +@media screen and (min-resolution: 1.5dppx){ + :root{ --uc-titlebar-scale-factor: 2px } +} +@media screen and (min-resolution: 2dppx){ + :root{ --uc-titlebar-scale-factor: 3px } +} + +:root[sizemode="maximized"]:not([inDOMFullscreen]){ margin-top: calc(10px - var(--uc-titlebar-scale-factor)) } #navigator-toolbox{ position: fixed !important; @@ -13,7 +24,9 @@ #navigator-toolbox > *{ line-height: normal } :root[sizemode="maximized"] > #navigator-toolbox{ margin-top: -2px } - +@media screen and (min-resolution: 1.5dppx){ + :root[sizemode="maximized"] > #navigator-toolbox{ margin-top: -1px } +} #navigator-toolbox, #navigator-toolbox > *{ width: 100vw;