diff --git a/CHANGELOG.md b/CHANGELOG.md index c7d3967..68a20a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -21,6 +21,7 @@ All notable changes to eww will be listed here, starting at changes since versio - Add support for `:hover` css selectors for eventbox (By: druskus20) - Add `eww get` subcommand (By: druskus20) - Add circular progress widget (By: druskus20) +- Add `:xalign` and `:yalign` to labels (By: alecsferra) - Add graph widget (By: druskus20) - Add `>=` and `<=` operators to simplexpr (By: viandoxdev) - Add `desktop` window type (By: Alvaro Lopez) diff --git a/crates/eww/src/widgets/widget_definitions.rs b/crates/eww/src/widgets/widget_definitions.rs index 4b98eff..97b8443 100644 --- a/crates/eww/src/widgets/widget_definitions.rs +++ b/crates/eww/src/widgets/widget_definitions.rs @@ -736,7 +736,11 @@ fn build_gtk_label(bargs: &mut BuilderArgs) -> Result { // @prop wrap - Wrap the text. This mainly makes sense if you set the width of this widget. prop(wrap: as_bool) { gtk_widget.set_line_wrap(wrap) }, // @prop angle - the angle of rotation for the label (between 0 - 360) - prop(angle: as_f64 = 0) { gtk_widget.set_angle(angle) } + prop(angle: as_f64 = 0) { gtk_widget.set_angle(angle) }, + // @prop xalign - the alignment of the label text on the x axis (between 0 - 1, 0 -> left, 0.5 -> center, 1 -> right) + prop(xalign: as_f64 = 0.5) { gtk_widget.set_xalign(xalign as f32) }, + // @prop yalign - the alignment of the label text on the y axis (between 0 - 1, 0 -> bottom, 0.5 -> center, 1 -> top) + prop(yalign: as_f64 = 0.5) { gtk_widget.set_yalign(yalign as f32) } }); Ok(gtk_widget) }