Sync dark theme preference for GTK3 applications

Authored by gikari on Dec 13 2019, 11:48 AM.


Sync dark theme preference for GTK3 applications

Previously preference of dark GTK3 theme was set by checkbox in GTK KCM. Now, the checkbox is removed and preference is set according to color scheme, the user set in Colors KCMm, using the same heuristic, used for filter combobox in that KCM.

This makes sense, because, suppose the user set Adwaita GTK3 theme, and their color scheme is something dark. Therefore their overall theme is supposedly dark, so Adwaita needs to be dark too.

Note, however, that this preference is somewhat buggy. It does not work in flatpak apps, it can't be autoreloaded with xsettingsd, and also it is applied after some time has passed (this is hypothetical). You can check these statements, using the present checkbox in GTK KCM.

Depends on D25872

Test Plan:

  1. Apply Adwaita GTK3 Theme
  2. Reload kded5
  3. Apply dark color scheme
  4. Wait some time
  5. (Re)open GTK3 app
  6. App should use Dark color scheme
  7. Apply light color scheme
  8. Wait some time
  9. Reopen GTK3 app
  10. App should use Light color scheme

Reviewers: apol, cblack, broulik, VDG

Reviewed By: apol, cblack

Subscribers: ngraham, GB_2, plasma-devel

Tags: Plasma

Maniphest Tasks: T10611

Differential Revision:


gikariDec 18 2019, 5:26 PM
Differential Revision
D25945: Sync dark theme preference for GTK3 applications
R99:13c4eee2553a: Refactor GTK KCM code