gtk-rs / gtk4-rs

Rust bindings of GTK 4
https://gtk-rs.org/gtk4-rs/
MIT License
1.89k stars 174 forks source link

Support for dark mode #1797

Closed philip-peterson closed 1 month ago

philip-peterson commented 4 months ago

I went looking for information on dark mode. It seems like it is normally supported by GTK4 apps through libadwaita. The way to access this through Rust may be libadwaita's StyleManager::is_dark.

https://docs.rs/libadwaita/latest/libadwaita/struct.StyleManager.html#method.is_dark

sdroege commented 4 months ago

As this is a general GTK question not directly related to the bindings, you'll probably have more luck at https://discourse.gnome.org

martinling commented 2 months ago

See https://github.com/greatscottgadgets/packetry/pull/166 for an example of doing this without libadwaita.

bilelmoussaoui commented 1 month ago

You can use https://docs.rs/ashpd/latest/ashpd/desktop/settings/struct.Settings.html#method.receive_color_scheme_changed as well.

Closing as it is not really an issue on the bindings side.