MrOtherGuy / firefox-csshacks

Collection of userstyles affecting the browser
Mozilla Public License 2.0
3.24k stars 315 forks source link

autohide toolbar: bigger hover area #345

Closed musjj closed 7 months ago

musjj commented 7 months ago

Is there a way to make it so that the hover area is bigger, so that you can more easily reveal the toolbar?

I often find myself "overshooting" just so that the hover event is triggered, which is kind of inefficient in terms of mouse movement.

MrOtherGuy commented 7 months ago

If you mean autohide_toolbox.css, then you can simply make the --uc-toolbox-rotation variable smaller. Line 11 controls normal windows, and line 15 is for maximized ones.

musjj commented 7 months ago

How about autohide_bookmarks_and_main_toolbars.css?

MrOtherGuy commented 7 months ago

That style should show the main toolbar and bookmarks toolbar whenever your cursor is hovering tabs toolbar or menubar. Is your intention that you would want toolbars to also show up if the cursor is somewhere nearby tabs toolbar or what? Doing that should be possible, but it would prevent you from interacting with top portion of web pages.

musjj commented 7 months ago

you would want toolbars to also show up if the cursor is somewhere nearby tabs toolbar

Yeah, this is kind of what I want. I don't think it'd too intrusive if it's only a few pixels tall, tbh. Most website controls aren't that up high after all.

MrOtherGuy commented 7 months ago

For that you'll need something more complicated to have it look okay. This should work if you add it to the end of the style:

:root[sessionrestored] #navigator-toolbox > .browser-toolbar{
  opacity: 0;
  transform: rotateX(70deg);
  transition-property: transform, opacity !important;
}
#mainPopupSet:has(> #appMenu-popup:hover) ~ #navigator-toolbox > .browser-toolbar,
:root[sessionrestored] #navigator-toolbox:is(:focus-within,:hover) > .browser-toolbar{
 opacity: 1; 
 transform: rotateX(0deg);
}
musjj commented 7 months ago

Thank you, this works great! This also means that I can reduce the padding of the tab bar, to save even more space:

#navigator-toolbox {
  --uc-navbar-height: -48px !important;
}

Btw, what value should I tweak to control the size of the hover area?

MrOtherGuy commented 7 months ago

Make the rotation parameter (70deg) smaller to increase the size of the trigger area. By defaults this style uses 90deg which effectively rotates the toolbars so much that it isn't visible. Rotation of 0deg on the other hand is effectively as if no transformation was done at all, thus the trigger area is as tall as the toolbars would normally be.

musjj commented 7 months ago

Thank you, that works perfectly!