Rename rest to leftover
The length kind that asks for a part of what is left once the fixed lengths are taken is called leftover: Len::leftover(2), Len::LEFTOVER, Size::LEFTOVER, Len::leftover the field, and apply_leftover. It says what it is where "rest" reads as "the remainder of the list" as often as "the remaining space", and every agent who has touched this has reached for a third word for it. Locals called rest that meant a region or a widget are renamed with it, since the word now names something else. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9644971daf
commit
691e3eb23c
16 files changed
+98
-89
No files matched your search
+7
-7
@@ -101,15 +101,15 @@ impl Widget for Branch {
|
||||
let mut top = UiRegion::FULL;
|
||||
top.y.end = top.y.start.offset(40.0);
|
||||
let measured = painter.place(&self.probe, top).len(Axis::X);
|
||||
let px = measured.apply_rest().to_px(painter.px_len(Axis::X));
|
||||
let px = measured.apply_leftover().to_px(painter.px_len(Axis::X));
|
||||
|
||||
let mut rest = UiRegion::FULL;
|
||||
rest.y.start = rest.y.start.offset(40.0);
|
||||
let mut below = UiRegion::FULL;
|
||||
below.y.start = below.y.start.offset(40.0);
|
||||
match px > self.threshold {
|
||||
true => painter.place(&self.wide, rest),
|
||||
false => painter.place(&self.narrow, rest),
|
||||
true => painter.place(&self.wide, below),
|
||||
false => painter.place(&self.narrow, below),
|
||||
};
|
||||
Size::REST
|
||||
Size::LEFTOVER
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ impl<Rsc: UiRsc + 'static> Grow<'_, Rsc> {
|
||||
fn len(&mut self) -> Option<Len> {
|
||||
match self.rng.below(4) {
|
||||
0 => Some(Len::px(20.0 + self.rng.below(180) as f32)),
|
||||
1 => Some(Len::REST),
|
||||
1 => Some(Len::LEFTOVER),
|
||||
_ => None,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user