mirror of
https://github.com/storytold/craft-libs.git
synced 2026-11-22 10:31:37 +01:00
design-lint: props: derive the setters of ui-widgets components (#[prop]) and drop the hand setters
This commit is contained in:
1 parent
bc9b545e5f
commit
da0fcfd21a
1 file changed
+3
-9
@@ -154,7 +154,9 @@ pub struct LinkedFields<'a, const N: usize> {
|
||||
/// Each field's own range.
|
||||
#[prop]
|
||||
ranges: Option<[RangeInclusive<f64>; N]>,
|
||||
/// The lengths every field keeps and shows (`LinkedFields::lengths`); plain numbers without it.
|
||||
/// Makes every field a length field (`NumberField::length`): the values are kept in `units.stored` and shown in
|
||||
/// `units.shown`. `range` is then in the stored unit.
|
||||
#[prop]
|
||||
lengths: Option<LengthUnits>,
|
||||
}
|
||||
|
||||
@@ -176,14 +178,6 @@ impl<'a, const N: usize> LinkedFields<'a, N> {
|
||||
.label(label)
|
||||
}
|
||||
|
||||
/// Makes every field a length field (`NumberField::length`): the values are kept in `units.stored` and shown in
|
||||
/// `units.shown`. `range` is then in the stored unit.
|
||||
#[must_use]
|
||||
pub fn lengths(mut self, units: LengthUnits) -> Self {
|
||||
self.lengths = Some(units);
|
||||
self
|
||||
}
|
||||
|
||||
/// Shows a caption with each field that also scrubs it, and names the field: inside the field at its start in the
|
||||
/// `Row` layout, beside it in the others. Without captions a field is named by the group's label and its position.
|
||||
#[must_use]
|
||||
|
||||
Reference in new issue
Block a user