ryonakano / konbucase

A case converting app suitable for coding or typing
GNU General Public License v3.0
10 stars 11 forks source link

Respect an elementary OS-wide dark preference #31

Closed ryonakano closed 4 years ago

ryonakano commented 4 years ago

Fixes #18

cassidyjames commented 4 years ago

You should not need to do all of this. :sweat_smile: The plug does it because it needs to be able to set the preference, but apps just need to read it which can be done entirely with Granite. See:

https://github.com/elementary/switchboard/pull/99/files

ryonakano commented 4 years ago

I did this because I wanted to support not only Odin but also Hera too. elementary OS does not officially support dark style on Hera, but some people use dark variant by using elementary Tweaks, and ways to set dark style differ between elementary Tweaks and our new preference.

elementary Tweaks saves the following content to ~/.config/gtk-3.0/settings.ini:

[Settings]
gtk-application-prefer-dark-theme=0

and this forces all apps to use dark style―including third-party apps like Google Chrome or Slack.

And since we don't have a new Plug on Hera and users can't change the value of granite_settings.prefers_color_scheme, its value is always Granite.Settings.ColorScheme.LIGHT, thus this line always set to false and the app is shown in light style, while users who prefers dark variant using elementary Tweaks on Hera expect the app is shown in dark style. Some people already noticed this issue when Switchboard 2.4.0 released: elementary-tweaks/elementary-tweaks#146

I do know elementary Tweaks is not an official thing and not recommended by us at all (and I don't use it at all), it does exist and some people use it. So I thought I might need these extra works.