Skip to content

Commit 1835529

Browse files
committed
userChrome.css: Switch to upstream solution
Taken from https://github.com/MrOtherGuy/firefox-csshacks/blob/master/chrome/autohide_toolbox.css Starting with Firefox 133, our little chrome file no longer works. - When a popup shows up (like the one to enable persistent storage when pointing to Matrix Element), it blinks and isn't clickable. - When Alt is pressed and the user interacts with the menubar, it disappears and isn't usable.. The solution from MrOtherGuy is overkill, it does way too much and it's a lot of code that can go wrong.. but at least it works. Instead of relying on Alt being pressed, it relies on hover and animations. Fixes #320 Fixes linuxmint/mint22.1-beta#85
1 parent ddd88f3 commit 1835529

File tree

1 file changed

+102
-8
lines changed

1 file changed

+102
-8
lines changed
Lines changed: 102 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,105 @@
1-
#navigator-toolbox:not(:hover, :focus, :active) {
2-
#toolbar-menubar[inactive="true"] ~ #TabsToolbar {
3-
visibility: collapse;
4-
}
5-
#toolbar-menubar[inactive="true"] ~ #nav-bar {
6-
visibility: collapse !important;
1+
/* Source file https://github.com/MrOtherGuy/firefox-csshacks/tree/master/chrome/autohide_toolbox.css made available under Mozilla Public License v. 2.0
2+
See the above repository for updates as well as full license text. */
3+
4+
/* Hide the whole toolbar area unless urlbar is focused or cursor is over the toolbar
5+
* Dimensions on non-Win10 OS probably needs to be adjusted.
6+
*/
7+
8+
:root{
9+
--uc-autohide-toolbox-delay: 200ms; /* Wait 0.1s before hiding toolbars */
10+
--uc-toolbox-rotation: 82deg; /* This may need to be lower on mac - like 75 or so */
11+
}
12+
13+
:root[sizemode="maximized"]{
14+
--uc-toolbox-rotation: 88.5deg;
15+
}
16+
17+
@media (-moz-platform: windows){
18+
:root:not([lwtheme]) #navigator-toolbox{ background-color: -moz-dialog !important; }
19+
}
20+
21+
:root[sizemode="fullscreen"],
22+
:root[sizemode="fullscreen"] #navigator-toolbox{ margin-top: 0 !important; }
23+
24+
#navigator-toolbox{
25+
--browser-area-z-index-toolbox: 3;
26+
position: fixed !important;
27+
background-color: var(--lwt-accent-color,black) !important;
28+
transition: transform 82ms linear, opacity 82ms linear !important;
29+
transition-delay: var(--uc-autohide-toolbox-delay) !important;
30+
transform-origin: top;
31+
transform: rotateX(var(--uc-toolbox-rotation));
32+
opacity: 0;
33+
line-height: 0;
34+
z-index: 1;
35+
pointer-events: none;
36+
}
37+
:root[sessionrestored] #urlbar[popover]{
38+
pointer-events: none;
39+
opacity: 0;
40+
transition: transform 82ms linear var(--uc-autohide-toolbox-delay), opacity 0ms calc(var(--uc-autohide-toolbox-delay) + 82ms);
41+
transform-origin: 0px calc(0px - var(--tab-min-height) - var(--tab-block-margin) * 2);
42+
transform: rotateX(89.9deg);
43+
}
44+
#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox #urlbar[popover],
45+
#navigator-toolbox:is(:hover,:focus-within) #urlbar[popover],
46+
#urlbar-container > #urlbar[popover]:is([focused],[open]){
47+
pointer-events: auto;
48+
opacity: 1;
49+
transition-delay: 33ms;
50+
transform: rotateX(0deg);
51+
}
52+
#mainPopupSet:has(> [panelopen]:not(#ask-chat-shortcuts,#tab-preview-panel)) ~ toolbox,
53+
#navigator-toolbox:has(#urlbar:is([open],[focus-within])),
54+
#navigator-toolbox:hover,
55+
#navigator-toolbox:focus-within{
56+
transition-delay: 33ms !important;
57+
transform: rotateX(0);
58+
opacity: 1;
59+
}
60+
/* This makes things like OS menubar/taskbar show the toolbox when hovered in maximized windows.
61+
* Unfortunately it also means that other OS native surfaces (such as context menu on macos)
62+
* and other always-on-top applications will trigger toolbox to show up. */
63+
@media (-moz-bool-pref: "userchrome.autohide-toolbox.unhide-by-native-ui.enabled"){
64+
:root[sizemode="maximized"]:not(:hover){
65+
#navigator-toolbox:not(:-moz-window-inactive),
66+
#urlbar[popover]:not(:-moz-window-inactive){
67+
transition-delay: 33ms !important;
68+
transform: rotateX(0);
69+
opacity: 1;
70+
}
771
}
872
}
9-
#navigator-toolbox {
10-
border-bottom: none !important;
73+
74+
#navigator-toolbox > *{ line-height: normal; pointer-events: auto }
75+
76+
#navigator-toolbox,
77+
#navigator-toolbox > *{
78+
width: 100vw;
79+
-moz-appearance: none !important;
80+
}
81+
82+
/* These two exist for oneliner compatibility */
83+
#nav-bar{ width: var(--uc-navigationbar-width,100vw) }
84+
#TabsToolbar{ width: calc(100vw - var(--uc-navigationbar-width,0px)) }
85+
86+
/* Don't apply transform before window has been fully created */
87+
:root:not([sessionrestored]) #navigator-toolbox{ transform:none !important }
88+
89+
:root[customizing] #navigator-toolbox{
90+
position: relative !important;
91+
transform: none !important;
92+
opacity: 1 !important;
1193
}
94+
95+
#navigator-toolbox[inFullscreen] > #PersonalToolbar,
96+
#PersonalToolbar[collapsed="true"]{ display: none }
97+
98+
/* Uncomment this if tabs toolbar is hidden with hide_tabs_toolbar.css */
99+
/*#titlebar{ margin-bottom: -9px }*/
100+
101+
/* Uncomment the following for compatibility with tabs_on_bottom.css - this isn't well tested though */
102+
/*
103+
#navigator-toolbox{ flex-direction: column; display: flex; }
104+
#titlebar{ order: 2 }
105+
*/

0 commit comments

Comments
 (0)