fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.17k stars 1.4k forks source link

Support XDG accent colour setting #4367

Open Jacalz opened 1 year ago

Jacalz commented 1 year ago

Checklist

Is your feature request related to a problem?

We do already have a setting for changing our primary colour which is basically the same as what other Linux desktops are calling their accent colour. This setting can currently on be set through fyne-settings (or by importing the settings panel into an application) and thus doesn't follow any user defined settings on their own desktop. Now that xdg-desktop-portal has added support for a standardised protocol (see https://github.com/flatpak/xdg-desktop-portal/pull/815), we ought to support that protocol like we do for dark theme and adapt accordingly.

I am aware that I am a bit early in opening this given that only Elementary (and maybe KDE Plasma) supports this but it doesn't hurt to make sure that we aren't too late to the game :)

Is it possible to construct a solution with the existing API?

Should be. We can probably update the xdg dark mode preference code to check accent colour as well.

Describe the solution you'd like to see.

Support the xdg accent colour protocol so changing the accent colour in for example Gnome (when they integrate support) also updates Fyne.

andydotxyz commented 12 months ago

Sounds cool :)

Jacalz commented 11 months ago

Seems to be well documented at https://flatpak.github.io/xdg-desktop-portal/docs/doc-org.freedesktop.portal.Settings.html. Will tackle this myself once I have a desktop (Gnome 46 next year?) that supports changing it :)

Jacalz commented 5 months ago

This will likely be possible to implement later this year when Gnome 47 is released and I've updated to Fedora 41: https://www.phoronix.com/news/GNOME-Shell-Accent-Color-Merged

Jacalz commented 5 months ago

I have the support wired up in the rymdport/portal package already: https://pkg.go.dev/github.com/rymdport/portal@v0.2.3/settings/appearance#GetAccentColor