Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[enhancement] GTK4 support #207

Open
Master811129 opened this issue Aug 9, 2022 · 11 comments
Open

[enhancement] GTK4 support #207

Master811129 opened this issue Aug 9, 2022 · 11 comments
Assignees
Milestone

Comments

@Master811129
Copy link

No description provided.

@Elbullazul
Copy link
Member

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

@danyeaw
Copy link
Contributor

danyeaw commented Dec 23, 2022

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
Copy link
Member

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
Copy link
Contributor

danyeaw commented Dec 29, 2022

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

@Elbullazul
Copy link
Member

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

@Elbullazul
Copy link
Member

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

@danyeaw
Copy link
Contributor

danyeaw commented Feb 5, 2023

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

@Elbullazul
Copy link
Member

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

@danyeaw
Copy link
Contributor

danyeaw commented Feb 12, 2023

@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
Copy link
Member

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
Copy link
Member

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

@Elbullazul Elbullazul added this to the v4.0 milestone Mar 9, 2023
@Elbullazul Elbullazul self-assigned this Mar 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants