gtkgnome

How can I make the GtkSource.View adapt to the dark mode?


I'm facing the problem that GtkSource.View does not change the theme based on the user's selected theme (light/dark mode). Here is a screenshot: Screenshot.

Interestingly, this works perfectly fine with Gtk.TextView. How can I make it work with GtkSource.View as well?


Solution

  • Gtk.SourceView has its own color scheme controlled by GtkSource.StyleScheme. If you want a dark theme look, you have to create a theme and apply it manually.

    Gtk.SourceView is not built on libadwaita, which implements the dark theme in Gnome.