Gtk3 how do I get headerbar to not change colors when unfocused?

⚓ Rust    📅 2025-09-05    👤 surdeus    👁️ 3      

surdeus

I am using gtk3 with rust. In my software, Headerbar looks like this when focused:

image

When unfocused it looks like this:

image

Is there a way to change this in css or any other kind of code?

this is my code:

           let header_bar = HeaderBar::new();
 header_buttons.back.set_image(Some(&Image::from_icon_name(Some("go-previous"), gtk::IconSize::Button)));
            header_buttons.back.set_always_show_image(true);
            header_bar.pack_start(&header_buttons.back);

            header_buttons.forward.set_image(Some(&Image::from_icon_name(Some("go-next"), gtk::IconSize::Button)));
            header_buttons.forward.set_always_show_image(true);
            header_bar.pack_start(&header_buttons.forward);
            
            header_buttons.new.set_image(Some(&Image::from_icon_name(Some("list-add"), gtk::IconSize::Button)));
            header_buttons.new.set_always_show_image(true);
            header_bar.pack_start(&header_buttons.new);

            header_buttons.delete.set_image(Some(&Image::from_icon_name(Some("edit-delete"), gtk::IconSize::Button)));
            header_buttons.delete.set_always_show_image(true);
            header_bar.pack_start(&header_buttons.delete);

            //main_area.borrow().add(&header_box);
            //vbox.pack_start(&header_bar, false, false, 0);
            mainbox.borrow().pack_start(&header_bar, false, false, 0);

1 post - 1 participant

Read full topic

🏷️ Rust_feed