Add support for "round-digits" property for scale widget (#509)

Co-authored-by: elkowar <5300871+elkowar@users.noreply.github.com>
This commit is contained in:
gavynriebau 2022-08-15 16:34:54 +08:00 committed by GitHub
parent 0a5d6f4ac9
commit 7a3e2f4448
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -36,6 +36,7 @@ All notable changes to eww will be listed here, starting at changes since versio
- Add `:onaccept` to input field, add `:onclick` to eventbox
- Add `EWW_CMD`, `EWW_CONFIG_DIR`, `EWW_EXECUTABLE` magic variables
- Add `overlay` widget (By: viandoxdev)
- Add `:round-digits` to scale widget (By: gavynriebau)
### Notable Internal changes
- Rework state management completely, now making local state and dynamic widget hierarchy changes possible.

View File

@ -394,6 +394,10 @@ fn build_gtk_scale(bargs: &mut BuilderArgs) -> Result<gtk::Scale> {
// @prop draw-value - draw the value of the property
prop(draw_value: as_bool = false) { gtk_widget.set_draw_value(draw_value) },
// @prop round-digits - Sets the number of decimals to round the value to when it changes
prop(round_digits: as_i32 = 0) { gtk_widget.set_round_digits(round_digits) }
});
Ok(gtk_widget)
}