cvfosammmm / Setzer

LaTeX editor written in Python with Gtk
https://www.cvfosammmm.org/setzer/
Other
390 stars 35 forks source link

Dark mode #209

Closed JusSolo closed 1 year ago

JusSolo commented 3 years ago

Dark mode doesen' t work on elementary os 6

Struma commented 3 years ago

Not on Ubuntu 20 either, the settings don't appear to have any visual effect and they are reset each time I re-open the dialog.

sebastiaanfranken commented 3 years ago

What happens when you run it as such from within the terminal:

$ GTK_THEME=Adwaita:dark setzer

For me, the default switch in the settings works (Fedora 34). If I run the terminal command above Setzer opens in light mode for me, which indicates 1) the command works and 2) my settings get saved.

Maybe a gsettings issue? Are other settings remembered/validated?

Struma commented 3 years ago

I will check in the morning, I just noticed that the dark theme is working on my home machine running the same OS. This leads me to believe my issue might be specific to my highly customized set up at work. Both machines are Xubutu flavors. I'll edit this comment in place if anything changes.

liferooter commented 2 years ago

Elementary OS 6 supports color scheme portal, so I guess the easiest way to implement dark mode support is using HdyStyleManager (AdwStyleManager when Setzer will be ported to GTK 4). There is docs: https://gnome.pages.gitlab.gnome.org/libhandy/doc/master/HdyStyleManager.html

(Hdy/Adw)StyleManager also supports GNOME 42's color schemes.

nekohayo commented 2 years ago

My understanding is that it rather needs to internally flip between its light and dark mode by listening to the Freedesktop dark preference thing (implemented by elementary 6, GNOME 42, KDE, etc.), which the user can automate (with this extension for example). In essence, the app wouldn't need a manual "dark mode" switch in its menus/prefs anymore, if it can simply follow the system (but if you want to retain the complexity of also exposing a preference in the app UI—which I don't particularly recommend—then see this potential approach).

You don't need libhandy nor gtk4 for this, as far as I know? Reference docs: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

liferooter commented 2 years ago

My understanding is that it rather needs to internally flip between its light and dark mode by listening to the Freedesktop dark preference thing (implemented by elementary 6, GNOME 42, KDE, etc.), which the user can automate (with this extension for example). In essence, the app wouldn't need a manual "dark mode" switch in its menus/prefs anymore, if it can simply follow the system (but if you want to retain the complexity of also exposing a preference in the app UI—which I don't particularly recommend—then see this potential approach).

You don't need libhandy nor gtk4 for this, as far as I know? Reference docs: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/

It's recommended by GNOME developers to add three variant switch: dark, light and system default, or just remove it.

nikkibeach commented 1 year ago

It's recommended by GNOME developers to add three variant switch: dark, light and system default, or just remove it.

Are there any plans to implement this, may I ask?

I really, really like the editor and it would be so cool if it could just use the system wide settings (I'm on GNOME 43 if that's of any concern).

Thanks!