Set custom GTK theme by path? (gtk-rs)

Is it possible to set custom theme in GTK 3 application? (better on gtk-rs)
I know that GIMP has option to choose between system theme and light-gray-dark preinstalled themes, which are (probably) located somewhere in GIMP config folders.
I have already tried to use GTK_THEME env variable, but the theme is erased to blank.

Ok, I’ve figured it out. Now I know, that GTK theme is just a CSS configuration for GTK elements, so I can use CssProvider component to apply it to my application:

use gtk::{CssProvider, StyleContext};
use gtk::prelude::*;

pub fn build(application: &gtk::Application){
    let glade_src = include_str!("../../layouts/");
    let builder = gtk::Builder::from_string(glade_src);
    let window: gtk::ApplicationWindow = builder.object("main_window").unwrap();
    let provider = CssProvider::new();
    let context = window.style_context();
    StyleContext::add_provider_for_screen(&gdk::Screen::default().unwrap(), &provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION);
fn main() {
    let application = gtk::Application::builder()

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.