Add scss support for style property (#1121)
* Add scss support for the ':style' widget property * Add changelog entry for the scss support for the ':style' property --------- Co-authored-by: ElKowar <dev@elkowar.dev>
This commit is contained in:
parent
510b824e75
commit
dc4def5327
2 changed files with 3 additions and 2 deletions
|
@ -18,6 +18,7 @@ All notable changes to eww will be listed here, starting at changes since versio
|
|||
- Add `:fill-svg` and `:preserve-aspect-ratio` properties to images (By: hypernova7, w-lfchen)
|
||||
- Add `:truncate` property to labels, disabled by default (except in cases where truncation would be enabled in version `0.5.0` and before) (By: Rayzeq).
|
||||
- Add support for `:hover` css selectors for tray items (By: zeapoz)
|
||||
- Add scss support for the `:style` widget property (By: ovalkonia)
|
||||
- Add `min` and `max` function calls to simplexpr (By: ovalkonia)
|
||||
|
||||
## [0.6.0] (21.04.2024)
|
||||
|
|
|
@ -209,10 +209,10 @@ pub(super) fn resolve_widget_attrs(bargs: &mut BuilderArgs, gtk_widget: >k::Wi
|
|||
prop(visible: as_bool = true) {
|
||||
if visible { gtk_widget.show(); } else { gtk_widget.hide(); }
|
||||
},
|
||||
// @prop style - inline css style applied to the widget
|
||||
// @prop style - inline scss style applied to the widget
|
||||
prop(style: as_string) {
|
||||
gtk_widget.reset_style();
|
||||
css_provider.load_from_data(format!("* {{ {} }}", style).as_bytes())?;
|
||||
css_provider.load_from_data(grass::from_string(format!("* {{ {} }}", style), &grass::Options::default())?.as_bytes())?;
|
||||
gtk_widget.style_context().add_provider(&css_provider, gtk::STYLE_PROVIDER_PRIORITY_APPLICATION)
|
||||
},
|
||||
// @prop css - scss code applied to the widget, i.e.: `button {color: red;}`
|
||||
|
|
Loading…
Add table
Reference in a new issue