MrOtherGuy / firefox-csshacks

Collection of userstyles affecting the browser
Mozilla Public License 2.0
3.05k stars 307 forks source link

Update window_control_placeholder_support.css to account for number of buttons when using GTK window controls #334

Open pettycrimes420 opened 6 months ago

pettycrimes420 commented 6 months ago

Replace -moz-gtk-csd-available check with separate conditions for each button and set --uc-window-control-width according to the number of buttons available. This is done to adjust layout to GNOME's titlebar buttons settings including the default which has only close button enabled

MrOtherGuy commented 6 months ago

This is definitely what we should do, except that surely the width can't be 0px when there is one button there, and 40px if there is two.

Until now I've used 84px for three buttons, so I'd guess that sane values would be 28px, 56px and 84px or something along those lines.

pettycrimes420 commented 6 months ago

I kinda thought so myself with 0px but for some reason it seems to work (1st screenshot) though I don't exactly know why 0px

28px might be a bit wide 28px

And also tried 9px which ended up looking the closest to what gtk4 has 9px Screenshot from 2024-01-15 18-16-19

MrOtherGuy commented 6 months ago

The second image actually looks as intended.

The buttons are supposed to be separated from the menu by width defined by --uc-window-drag-space-post in window_control_placeholder_support.css. It's purpose is to create space close to window controls where you can drag window from. This kind of space exists in tabs toolbar as well and we want it to exist even if tabs toolbar itself is gone.

But yes you can just set that variable to 0px if you don't want such space.