arc-theme icon indicating copy to clipboard operation
arc-theme copied to clipboard

GTK 4 support

Open wb9688 opened this issue 6 years ago • 25 comments

It would be nice if it has GTK 4 support, preferably before GTK 4 gets released. In GTK 4, some selectors have been changed and widget style properties are deprecated in favor of CSS properties. The easiest way to know what has changed would be to do a git diff origin/gtk-3-24 origin/master -- gtk/theme/Adwaita/ after cloning https://gitlab.gnome.org/GNOME/gtk, i.e. look at the changes in Adwaita between GTK 3 and 4.

wb9688 avatar Jul 12 '20 19:07 wb9688

GTK4 theme is definitely planned, but I can't promise it will be done before its stable release, as there's some other work I consider higher priority. I'm also not sure whether the theme would be actually of much use yet, or if even the GNOME 3.38 applications would be yet switching to GTK4, or will still be GTK3 (if anyone can confirm this, please let me know).

My plan is to rewrite the GTK4 theme based on upstream, instead of basing it on the GTK3 theme. This also takes more time, but it's far better for future maintenance. If there's an urgent need for the GTK4 theme I may try basing it on the GTK3 first, if that works without much tweaking.

jnsh avatar Jul 17 '20 14:07 jnsh

E.g. GNOME To Do is already using GTK 4 (in the master branch at least). There will be a release post for GTK 3.99 soon, which should clarify things.

wb9688 avatar Jul 17 '20 14:07 wb9688

Hello. Did GTK4 support land already?

juxuanu avatar Feb 08 '21 01:02 juxuanu

Not yet, but I'm working on it. I'm hoping to have usable version out not too long after the next GNOME release, but don't want to give any promises.

jnsh avatar Feb 08 '21 01:02 jnsh

@jnsh have you been able to work on any plans for GNOME 40's theming considering the associated UI changes? Does it seem to be very difficult with all the changes? Maybe the community can help with that if we know what is needed.

liamtimms avatar Feb 18 '21 15:02 liamtimms

@liamtimms So far the changes to GNOME 40's stylesheet don't seem bigger than usual, and since they have reached the UI freeze for this cycle, I wouldn't expect any major further changes.

Therefore I wouldn't say I need help with it, but pull requests are always welcome. However in case of the gnome-shell update, I'd wait until closer to the hard code freeze before starting to work on it.

jnsh avatar Feb 18 '21 16:02 jnsh

@jnsh makes sense, thanks.

liamtimms avatar Feb 18 '21 16:02 liamtimms

@jnsh just to clarify. The goal is to adapt upstream theme code structure and adjust scss & assets, correct?

zeten30 avatar Apr 28 '21 15:04 zeten30

Hi! What is GTK4 support landing progress?

zefkerr avatar May 12 '21 14:05 zefkerr

I know some css, if I wanted to help where would i start from?

RazerPC avatar Jun 18 '21 16:06 RazerPC

@Razer0123 Until the initial GTK4 port is pushed to the repo, there's really nothing that anyone else could do to help. Porting the theme is rather elaborate process, and having multiple people working on it would require some coordination. Thank you for the offer for help regardless.

If you notice any issues or anything that could be improved in the SASS of any published code, pull requests are always welcome. If working on the code is beyond your skills, simply reporting your finds is also a big help and greatly appreciated.

Unfortunately I've been preoccupied with other things lately, and haven't been able to do much work on the theme. However, the GTK4 port is the thing I'm currently working on.

@zeten30 Sorry about the late reply...

@jnsh just to clarify. The goal is to adapt upstream theme code structure and adjust scss & assets, correct?

Basically yes. The Arc GTK4 will be based on Adwaita/Default GTK4 theme. Then any Arc specific styling in the GTK3 theme code is adapted to the new GTK4 port, and finally any remaining visual differences between the Arc GTK3 and GTK4 themes will be fixed.

jnsh avatar Jun 18 '21 20:06 jnsh

Any news about it?

RazerPC avatar Aug 20 '21 16:08 RazerPC

I have pushed the still work-in-progress GTK4 port in the gtk4 branch. It should be perfectly usable, but there are still plenty of small issues and inconsistencies compared to the GTK3 theme.

To test, you can clone the gtk4 branch e.g. with:

git clone -b gtk4 https://github.com/jnsh/arc-theme.git

Then build as usual. GTK4 theme is built by default, but if you change the themes= build option, make sure to add gtk4 to the list.

Notes:

  • Theme is currently based on GTK 4.2, but should work at least nearly as well with 4.4. GTK 4.0 may have more notable issues, and currently there are no plans to back-port the theme unless there's some dire need for it.
  • libadwaita (i.e. libhandy for GTK4) is currently not supported, but the support will be added in the future. Until then, any GTK4 applications using libadwaita may have some notable visual issues with Arc-theme.

Please let me know if you encounter any major problems (something completely broken or unusable). Reporting smaller visual inconsistencies is probably not useful yet.

jnsh avatar Sep 18 '21 22:09 jnsh

I've pushed most likely the final update to the WIP gtk4 branch (sans some build system work and a lot of cleanup) before merging it to master, and then rolling out next release if all looks well. There still seems to be some strange issues that don't seem related to the theme stylesheet, so I'm not holding the release because of them.

Either way, if anyone is testing the theme, at this point I'm happy to hear about any small issues you may notice.

jnsh avatar Sep 30 '21 00:09 jnsh

I gave it a try and it seems fine with the two GTK4 applications I have to test it with. I use a script that replaces all the colors with a solarized palette and it didn't even need to be modified to work with the new branch.

ReillyBrogan avatar Sep 30 '21 03:09 ReillyBrogan

@jnsh I've tested the new branch and didn't experience any issues. Great job. Thank you!

zeten30 avatar Oct 01 '21 08:10 zeten30

@jnsh Hi. Is it possible to apply Arc-Theme for gtk4 windows in Gnome-44? gnome-tweaks-42.0_beta does not impact on gtk4-applications. "User Themes" extension can only make Arc themes for gnome panel.

reagentoo avatar Aug 09 '23 11:08 reagentoo

@jnsh Hi. Is it possible to apply Arc-Theme for gtk4 windows in Gnome-44? gnome-tweaks-42.0_beta does not impact on gtk4-applications. "User Themes" extension can only make Arc themes for gnome panel.

GTK4 doesn't support any user themes. Adwaita only available now.

zefkerr avatar Aug 09 '23 11:08 zefkerr

GTK4 doesn't support any user themes. Adwaita only available now.

This is incorrect.

@reagentoo GTK4 does support theming just like GTK3. The catch is, most GNOME applications use the libadwaita library, which does prevent theming on purpose. However you can force theming for libadwaita with the GTK_THEME environment variable, but the result may not be always perfect.

Old messages with more details: https://github.com/jnsh/arc-theme/issues/189#issuecomment-1122433945 https://github.com/jnsh/arc-theme/issues/201#issuecomment-1361797567

jnsh avatar Aug 09 '23 13:08 jnsh

@reagentoo GTK4 does support theming just like GTK3. The catch is, most GNOME applications use the libadwaita library, which does prevent theming on purpose. However you can force theming for libadwaita with the GTK_THEME environment variable, but the result may not be always perfect.

Thanks! I'm satisfied with this workaround. I've got all GTK4-apps working with Arc-Dark (gnome-control-center, gnome-text-editor, gnome-extensions-app), even of kgx (new Gnome console).

reagentoo avatar Aug 09 '23 14:08 reagentoo