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

Support for user themes with GtkThemeFlutter #14

Open
simrat39 opened this issue Nov 15, 2021 · 16 comments
Open

Support for user themes with GtkThemeFlutter #14

simrat39 opened this issue Nov 15, 2021 · 16 comments

Comments

@simrat39
Copy link
Member

simrat39 commented Nov 15, 2021

So i'm writing this linux only plugin which uses method channels and gtk stuff to get the colors and stuff. I plan on supporting shadows, gradients and all that jazz so this is something to think about, we could have almost pixel perfect gtk apps with flutter

https://github.com/simrat39/GtkThemeFlutter

@simrat39 simrat39 changed the title Support for user themes with https://github.com/simrat39/GtkThemeFlutter Support for user themes with GtkThemeFlutter Nov 15, 2021
@prateekmedia
Copy link
Member

This method might be better then our previous attempt to support it by using using css.

@MalcolmMielle What do you think?

@prateekmedia
Copy link
Member

@simrat39 I am moving this to an organisation, you can also add GtkThemeFlutter package to that (if you want).

@MalcolmMielle
Copy link
Collaborator

MalcolmMielle commented Nov 15, 2021

That looks good but that would fit better with the libadwaita package i just published than this one i think :). So we could integrate the colors directly in the material theme.

@simrat39 will your package still be compatible with the new libadwaita coming soon? The way that update is handled is so confusing to me :(

@prateekmedia
Copy link
Member

@MalcolmMielle Flutter is still using gtk3, and libadwaita is gtk4 library, so that might not be possible.

@MalcolmMielle
Copy link
Collaborator

My question is more if GtkThemeFlutter is still going to work with the planned update to GTK and libadwaita in 6 months. Sorry if it's a stupid question @simrat39 I'm just not super familiar with it.

@prateekmedia
Copy link
Member

@MalcolmMielle Yes, There will still be Gtk3 apps and themes, So this plugin will grab gtk3 theme from system until flutter switches to Gtk4 (Then we can modify code to get it from libadwaita).

@MalcolmMielle
Copy link
Collaborator

Would it be possible to integrate GtkThemeFlutter directly in adwaita and use it to fetch the theme values when on Linux while keeping the default adwaita colors for other platforms? That way, the gtk-flutter framework stays multi-platform?

@prateekmedia
Copy link
Member

prateekmedia commented Nov 15, 2021

@MalcolmMielle Ofcourse, but let's first ask @simrat39, as GtkThemeFlutter is not published yet. So if sim can add this directly to adwaita.

Btw @MalcolmMielle your git config is really messed up, so your commits will not count for your account. Please correct it in ~/.gitconfig

@simrat39
Copy link
Member Author

Afaik, libadwaita and how gtk does theming are two separate things, so the plugin should work even with gtk 4, as for moving it to the adwaita package, I would advise against it because it can have more usecases other than this. Maybe the adwaita package can use this plugin to get the theme or provide some helper functions to do so, idk not sure about that

@MalcolmMielle
Copy link
Collaborator

I'm fine with your suggestion to keep them separated and to use GtkFlutterTheme in adwaita to fetch the user's theme if possible and propagate it to the user. That sounds viable to me. @simrat39 ping me when you think I can use it in adwaita :D. Thanks for the great work, I'll be very glad to get rid of manual theming!


AFAIU (god is theming complicated) libadwaita provides both the widget and the stylesheet:

The Adwaita stylesheet will be moved to libadwaita, including its variants such as HighContrast and HighContrastInverse. GTK will keep a copy of that stylesheet renamed Default, that will focus on the needs of vanilla GTK applications. See gtk!3079 and gtk#3582 for more information. We want that to happen early in the development of libadwaita.

For now, with flutter, we have adwaita providing the theme and gtk-flutter providing the widget. @prateekmedia maybe renaming the package to follow that convention later would be a good idea? Something like gtk-flutter -> libadwaita and adwaita -> adwaita.theme, for example?

@simrat39
Copy link
Member Author

@MalcolmMielle yes it provides the default stylesheet, which can be overriden by user themes, and then read by gtk and provided to us, so it shouldn't be much of an issue

@simrat39
Copy link
Member Author

@prateekmedia could you give me proper perms in the org? i cant seem to rename the plugin repo

@MalcolmMielle
Copy link
Collaborator

@prateekmedia I'm going to jump on this thread to ask for the same thing, to rename libadwaita to something more fitting ;)

@prateekmedia
Copy link
Member

prateekmedia commented Nov 16, 2021

@prateekmedia could you give me proper perms in the org? i cant seem to rename the plugin repo

Sorry for being late, it was sleeping time here in India. I have given you Admin permissions in GtkThemeFlutter, also could you rename it to something useful?

@prateekmedia
Copy link
Member

prateekmedia commented Nov 16, 2021

@MalcolmMielle I have given you admin to libadwaita, now you can rename that to adwaita.theme.

@simrat39
Copy link
Member Author

@prateekmedia could you give me proper perms in the org? i cant seem to rename the plugin repo

Sorry for being late, it was sleeping time here in India. I have given you Admin permissions in GtkThemeFlutter, also could you rename it to something useful?

no problemo, i'm not too good with names so i'll go with 'gtk_theme_fl'

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