B00merang-Project / Windows-10

Windows 10 Light theme for Linux (GTK)
http://b00merang.weebly.com/windows-10.html
GNU General Public License v3.0
812 stars 113 forks source link

[enhancement] GTK4 support #207

Open Master811129 opened 2 years ago

Elbullazul commented 1 year ago

71afdd6 adds experimental support for GTK4. More improvements are coming in the next few weeks

danyeaw commented 1 year ago

This is what I currently get when trying to use the experimental GTK4 support:

(process:20848): Gtk-WARNING **: 09:18:58.666: Theme parser error: gtk.css:33:5-24: No property named "-gtk-outline-radius"
(process:20848): Gtk-WARNING **: 09:18:58.666: Theme parser error: gtk.css:185:3-28: No property named "-GtkToolbar-button-relief"
(process:20848): Gtk-WARNING **: 09:18:58.681: Theme parser error: gtk.css:558:5-30: No property named "-GtkToolbar-button-relief"
(process:20848): Gtk-WARNING **: 09:18:58.681: Theme parser error: gtk.css:561:3-29: No property named "-GtkWidget-window-dragging"
(process:20848): Gtk-WARNING **: 09:18:58.687: Theme parser error: gtk.css:954:3-31: No property named "-treeview-vertical-separator"
(process:20848): Gtk-WARNING **: 09:18:58.687: Theme parser error: gtk.css:1097:3-29: No property named "-GtkWidget-window-dragging"
(process:20848): Gtk-WARNING **: 09:18:58.687: Theme parser error: gtk.css:1532:5-24: No property named "-gtk-outline-radius"
(process:20848): Gtk-WARNING **: 09:18:58.687: Theme parser error: gtk.css:1572:5-24: No property named "-gtk-outline-radius"
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:1773:21-35: Not a valid image
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:1782:21-35: Not a valid image
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:1791:21-35: Not a valid image
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:1800:21-35: Not a valid image
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:1876:5-31: No property named "-GtkWidget-window-dragging"
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:1887:5-31: No property named "-GtkWidget-window-dragging"
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:2026:3-22: No property named "-gtk-outline-radius"
(process:20848): Gtk-WARNING **: 09:18:58.697: Theme parser error: gtk.css:2120:3-22: No property named "-gtk-outline-radius"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:2335:3-22: No property named "-gtk-outline-radius"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:2846:3-29: No property named "-NaTrayApplet-icon-padding"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:2847:3-26: No property named "-NaTrayApplet-icon-size"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:2904:5-31: No property named "-NaTrayApplet-icon-padding"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3027:3-27: No property named "-UnityDecoration-extents"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3028:3-33: No property named "-UnityDecoration-input-extents"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3029:3-35: No property named "-UnityDecoration-shadow-offset-x"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3030:3-35: No property named "-UnityDecoration-shadow-offset-y"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3031:3-39: No property named "-UnityDecoration-active-shadow-color"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3032:3-40: No property named "-UnityDecoration-active-shadow-radius"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3033:3-41: No property named "-UnityDecoration-inactive-shadow-color"
(process:20848): Gtk-WARNING **: 09:18:58.713: Theme parser error: gtk.css:3034:3-42: No property named "-UnityDecoration-inactive-shadow-radius"
(process:20848): Gtk-WARNING **: 09:19:03.995: Theme parser error: gtk.css:3035:3-29: No property named "-UnityDecoration-glow-size"
(process:20848): Gtk-WARNING **: 09:19:04.428: Theme parser error: gtk.css:3036:3-30: No property named "-UnityDecoration-glow-color"
(process:20848): Gtk-WARNING **: 09:19:05.221: Theme parser error: gtk.css:3037:3-32: No property named "-UnityDecoration-title-indent"
(process:20848): Gtk-WARNING **: 09:19:05.933: Theme parser error: gtk.css:3038:3-30: No property named "-UnityDecoration-title-fade"
(process:20848): Gtk-WARNING **: 09:19:08.177: Theme parser error: gtk.css:3039:3-35: No property named "-UnityDecoration-title-alignment"

I'm glad to help out with this, do we just need to remove these extra properties?

Elbullazul commented 1 year ago

Some of them can be removed, like the Unity* stuff.

Some properties have to be renamed, I'll try to fix this on Sunday

danyeaw commented 1 year ago

Hi @Elbullazul, were you able to make any progress on this over the weekend? How can I help?

Elbullazul commented 1 year ago

Sorry for the delay. I made the changes on the wrong branch on my pc 🤦‍♂️. working to merge the changes by next week

Elbullazul commented 1 year ago

741e0c50babd0f15a066adf88c10f85d8aba526b removes deprecated properties. I'll need a little bit more time to fix the 'Not a valid image' warnings.

danyeaw commented 1 year ago

Hi @Elbullazul how do the Not a valid image warnings get fixed? I can do the leg work to make the updates.

Elbullazul commented 1 year ago

@danyeaw I'm not getting Not a valid image warnings on my side, are you still getting them?

danyeaw commented 1 year ago

@Elbullazul Nice one, I am not getting any errors now!

I notice if I do a simple GTK hello world app, the theme is working fine:

import gi
gi.require_version('Gtk', '4.0')
from gi.repository import Gtk

def on_activate(app):
    win = Gtk.ApplicationWindow(application=app, title="Hello GTK4")
    win.present()

app = Gtk.Application()
app.connect('activate', on_activate)

app.run(None)

image

However if I make the GTK app use libadwaita, the theme no longer works:

import gi
import sys

gi.require_version('Gtk', '4.0')
gi.require_version('Adw', '1')

from gi.repository import Adw, Gtk

class MyApplication(Adw.Application):
    """The main application."""

    def do_activate(self):
        window = Gtk.ApplicationWindow(application=self)
        window.set_title("Welcome to GNOME")
        window.present()

app = MyApplication()
exit_status = app.run(sys.argv)
sys.exit(exit_status)

image

Would it be possible to add libadwaita support for the theme as well?

Elbullazul commented 1 year ago

the theme works mostly fine with Libadwaita apps, you just have to override the theme.

I developed a script to do just that, you can find it here

Elbullazul commented 1 year ago

I realize I may have not been very clear. To make a Libadwaita app use a specific theme, you need to copy the contents of gtk-4.0 (gtk.css, gtk-dark.css, assets) to ~/.config/gtk-4.0. To 'uninstall' it, just remove the copied files