lunakurame / firefox-gnome-theme

A theme for Firefox 57+ matching GNOME Adwaita.
The Unlicense
201 stars 15 forks source link

Client-side decorations mode support #3

Closed smithfred closed 6 years ago

smithfred commented 6 years ago

Nice work on this :)

Would be great to have full support for Moz's new/upcoming client-side decorations mode. AFAIK it's not available in vanilla FF57, but Fedora have patched in support (you could test it in a VM if you're using a different distro), and I believe it's also available on FF nightly. The relevant about:config key is widget.allow-client-side-decoration.

At the moment, the theme more or less works, but there is 2-3 times the right amount of padding above the header bar widgets, and there are no window controls (at least the close button is missing; presumably the others would also be if they'd been enabled via e.g. Tweaks).

lunakurame commented 6 years ago

Thanks! I will add CSD support when it's available, of course, but I just checked and it's not available on FF nightly (59.0a1-20171207100053) yet. The key is not present and when I add it manually, it does nothing. I'll take a look at Fedora's patched version when it finishes downloading and see what I can do.

lunakurame commented 6 years ago

Okay so looks like I can't run Firefox' dev tools in a virtual machine, because the whole VM just freezes. When I run Fedora's Firefox in a VM using the host system's X server via ssh it doesn't crash immediately, still lags so hard it's barely usable, but I managed to write this piece of code. Looks like this:

Experimental CSD support for Fedora

It's still broken in many ways, works only for the close button and only if it's on the right side, the separator between window controls and the rest of the buttons is missing and there's still visible a horizontal bar at the top of the window if the window is maximized. I have no idea what to do about those problems, but I'll take a look at it when I have some free time again. For now I hope this patch makes it a bit more usable.

You need to enable this module in the userChrome.css file if you wanna use it.

rafaelmardojai commented 6 years ago

captura de pantalla de 2017-12-12 13-33-28

@kurogetsusai I am working on it (i use fedora), i will share it when is finished.

Styles from https://git.gnome.org/browse/gtk+/plain/gtk/theme/Adwaita/gtk-contained-dark.css.

smithfred commented 6 years ago

Looking great already! :)

rafaelmardojai commented 6 years ago

Please, test the progress here https://github.com/rafaelmardojai/firefox-gnome-theme/

Currently only work for Adwaita-dark. For window buttons options edit userChrome.css.

captura de pantalla de 2017-12-12 17-52-51

captura de pantalla de 2017-12-12 17-51-44

lunakurame commented 6 years ago

That looks awesome on your screenshots, good job! I can't really test it since I don't use Fedora, I managed to run it in a VM but it crashed after like 10 seconds. What's with that theme tho? It looks different than my dark Adwaita. I'm using GNOME 3.18.5, maybe we should add different versions too, since yours appears to be different? Only the variant files would be different, they only contain variables, not actual rules, currently we have two: theme-dark.css and theme-light.css, might as well rename them and add something like gnome-3.26-dark.css or whatever Fedora uses.

Also I see you modified other files too, not just fedora-csd.css, which breaks a lot of things if CSD is disabled or if you run it on others distros.

lunakurame commented 6 years ago

Also I noticed Mozilla added native CSD support to Firefox Nightly (at least it is present in FF 59.0a1-20171214220032), but it's not the same patch that Fedora uses. It can be enabled by going to Customize → uncheck the Title Bar option. Since it's different than Fedora's patch, the styles @rafaelmardojai wrote need some adjustments to work with FF Nightly properly. I'll correct them later, when we have a stable-ish code for Fedora's CSD, since FF Nightly is something I can test and debug. For now it looks like this:

FF Nightly's CSD + CSS for Fedora's CSD

rafaelmardojai commented 6 years ago

@kurogetsusai, yes i customized it to match 3.26. I edited theme.css to add the variable --gnome-headerbar-button-bottom-border-color to follow 3.26 design (buttons have a diferent border color at the bottom), nothing is break with CDS disabled.

Maybe for Firefox Nightly CSD we should add csd.css (i think is the same patch of Fedora made by Martin Stransky but more updated). I'm working on Firefox Nightly now (i think my fedora-csd.css is enough stable for Fedora Firefox 57 users).

Regards!

rafaelmardojai commented 6 years ago

Hey! I just updated my fork, with your new changes, and Firefox Nightly CSD support.

firefox-nativejh

lunakurame commented 6 years ago

Well, that's pretty much done, so I'll merge your changes into my repo. Well done, you're good at this. 😛

lunakurame commented 6 years ago

Merged, fixed minor bugs, tested all color variants on FF 57, 58, 59, everything seems to work (CSD works only on 59 and 57 with Fedora's patch, of course), so I'm closing this. Thanks again! :D

ghost commented 6 years ago

@rafaelmardojai, can you also create a light version of the 3.26 theme? Thanks for your work!

rafaelmardojai commented 6 years ago

@d9h20f of course, when i have some free time i will do it.

lunakurame commented 6 years ago

@rafaelmardojai BTW today I discovered that Firefox has a pseudo-class to detect whether the window has focus or not: :-moz-window-inactive. GNOME styles inactive windows differently, all buttons and gradients become flat, so I added that feature too! :D Commit 94e3946ed65aa1b5e19bbdccf8c42555c6198ff9, looks like this:

Comparison of an active and inactive window (An active and an inactive window.)

I added all the styles to my GNOME 3.18 themes, but not your 3.26 one, because I don't know how is it supposed to look like. If you want, you can add them too (just replace variables starting with --gnome-inactive- in the gnome-3.26-dark.css file, if they are different than for active windows). If you need a solid color for a variable which expects an image (or gradient), you can use a gradient with two identical colors, eg.

:root {
    --gnome-inactive-example-bgimage: linear-gradient(#fff, #fff);
}