endlessm / endless-key-flatpak

Endless Key for Flatpak
MIT License
4 stars 4 forks source link

Set GTK UI/branding colors #65

Open cassidyjames opened 1 year ago

cassidyjames commented 1 year ago

This should not be too hard thanks to Adwaita.

Screenshot from 2023-09-15 17-23-05

In GTK inspector, I just set:

@define-color headerbar_bg_color #f15a22;
@define-color headerbar_backdrop_color @headerbar_bg_color;
@define-color headerbar_fg_color white;

@define-color accent_color #f15a22;
@define-color window_bg_color #f8f7f3;

To implement, we'd just need to GResource a style.css with the above.

For example, we could do:

#12272a #f15a22 #f8f7f3
Screenshot from 2023-09-14 10-23-24 Screenshot from 2023-09-14 10-22-58 Screenshot from 2023-09-14 10-20-37
dylanmccall commented 1 year ago

For reference, we implemented that for a little while before reverting it over here:

https://github.com/endlessm/kolibri-installer-gnome/pull/10/commits/84230a596730e093d1838b8cf3380f9f26c4e6ff

https://github.com/endlessm/kolibri-installer-gnome/pull/10/commits/aee846d3959b806df571c841c3b4fd78d7847013

And indeed, we might find that this works better in the context of the Explore plugin since the navigation bar in the web app itself is a nice neutral colour :) However, things do get a bit awkward when we're looking at channels themselves, since those do have brightly coloured navigation bars.

jprvita commented 1 year ago

Wouldn't this be stepping over the user's own theme preferences? In addition to potentially being seen as rude / annoying, I think it may affect accessibility settings.

cassidyjames commented 1 year ago

@jprvita no, Adwaita as used in GTK4 and Flatpak is already designed in this way; Adwaita already uses its own styling and does not inherit any system "theme". And these variables are explicitly provided by Adwaita as part of the API for apps to use for more interesting styling. :)

Light/dark style is implemented as the FreeDesktop preference and could be considered here, as well as the high contrast style; I would just need to test with those preferences to ensure this is handled well.

cassidyjames commented 1 year ago

@dylanmccall in that case, I would lean towards using the dark gray headerbar background color; it matches the default top bar when viewing a channel, and more closely matches what ChromeOS does with its titlebar as well.