(
widget: St.Widget,
style_class: string,
enabled: boolean
)
| 1 | import St from 'gi://St'; |
| 2 | /** Sets whether the widget has the given style class */ |
| 3 | export function set_style_class( |
| 4 | widget: St.Widget, |
| 5 | style_class: string, |
| 6 | enabled: boolean |
| 7 | ) { |
| 8 | if (enabled) { |
| 9 | if (!widget.has_style_class_name(style_class)) { |
| 10 | widget.add_style_class_name(style_class); |
| 11 | } |
| 12 | } else { |
| 13 | if (widget.has_style_class_name(style_class)) { |
| 14 | widget.remove_style_class_name(style_class); |
| 15 | } |
| 16 | } |
| 17 | } |
no test coverage detected