-
-
Notifications
You must be signed in to change notification settings - Fork 61
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
Init: set accent color from portal #704
base: main
Are you sure you want to change the base?
Conversation
@danirabbit Hmm, could you tell me how to test this? Maybe using an label with .accent style in a Flatpak app and then changing accent color in System Settings? 🤔 |
@ryonakano it should work with the demo. I can’t remember if this needs the new granite stylesheet or if it works with the current stylesheet though. You might need to set the stylesheet in inspector to Granite |
This comment was marked as resolved.
This comment was marked as resolved.
@@ -1,3 +1,11 @@ | |||
.accent { | |||
color: #{'mix(@accent_color, @fg_color, 0.27)'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this will produce very good results for e.g. yellow. In libadwaita I had much better results with oklch colorspace (tho that would require you to update gtk once 4.16 is out)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, that or calculate it programmatically ofc, then you don't need to wait.
I see what's happening. It stops working once you open inspector. Looks like while you do support multiple GdkDisplays for the most part, What does completely fail to pick changes for me is color-scheme instead, at least in calculator. |
@@ -61,7 +61,7 @@ namespace Granite { | |||
|
|||
Gtk.StyleContext.remove_provider_for_display (display, accent_provider); | |||
accent_provider.load_from_string ("@define-color accent_color %s;".printf (accent_color)); | |||
Gtk.StyleContext.add_provider_for_display (display, accent_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); | |||
Gtk.StyleContext.add_provider_for_display (display, accent_provider, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd use THEME + 1 instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried THEME + 1 but it didn't work for some reason
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh. THat is strange.
|
||
accent_color = parse_color (variant); | ||
|
||
portal.setting_changed.connect ((scheme, key, value) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@alice-mkh maybe it's because I'm on an older version of some library but I'm not getting anything at all here when I change the color in system settings so I can't really test further because it's broken for me all the way at the beginning
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Huh okay. It did work for me, but only until I open inspector due to the global provider issue I mentioned.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I can't even test that 😅
It currently isn't being updated while running because it looks like our portal isn't sending settings-changed signals?
Requires: