mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-07-05 12:31:04 +02:00
BREAKING CHANGE: To allow for the `name` property, any widgets that were previously targeted by name should be targeted by class instead. This affects **all modules and all popups**, as well as several widgets inside modules. **This will break a lot of rules in your stylesheet**. To attempt to mitigate the damage, a migration script can be found [here](https://raw.githubusercontent.com/JakeStanger/ironbar/master/scripts/migrate-styles.sh) that should get you most of the way. Resolves #75.
8 lines
199 B
Rust
8 lines
199 B
Rust
use glib::IsA;
|
|
use gtk::prelude::*;
|
|
use gtk::Widget;
|
|
|
|
/// Adds a new CSS class to a widget.
|
|
pub fn add_class<W: IsA<Widget>>(widget: &W, class: &str) {
|
|
widget.style_context().add_class(class);
|
|
}
|