Spinner widgets for distances are weird, because the step size probably shouldn't depend on the user's metric/imperial setting. Just flip the prior hack and always use meters for the spinners. Sorry not sorry USA users.

This commit is contained in:
Dustin Carlino 2022-04-30 15:32:24 +01:00
parent aff8d8ceef
commit ae8d6f6cf2
2 changed files with 10 additions and 10 deletions

View File

@ -821,15 +821,15 @@ fn make_main_panel(
Spinner::widget_with_custom_rendering(
ctx,
"width custom",
(Distance::feet(1.0), Distance::feet(20.0)),
(Distance::meters(0.3), Distance::meters(7.0)),
lane.width,
Distance::feet(0.5),
// Even if the user's settings are set to meters, our step size is in feet, so
// just render in feet.
Distance::meters(0.1),
// Even if the user's settings are set to feet, our step size is in meters, so
// just render in meters.
Box::new(|x| {
x.to_string(&UnitFmt {
round_durations: false,
metric: false,
metric: true,
})
}),
),

View File

@ -277,15 +277,15 @@ impl Filters {
Spinner::widget_with_custom_rendering(
ctx,
"max_elevation_gain",
(Distance::ZERO, Distance::feet(500.0)),
(Distance::ZERO, Distance::meters(500.0)),
self.max_elevation_gain,
Distance::feet(10.0),
// Even if the user's settings are set to meters, our step size is in feet, so
// just render in feet.
Distance::meters(1.0),
// Even if the user's settings are set to feet, our step size is in meters, so
// just render in meters.
Box::new(|x| {
x.to_string(&UnitFmt {
round_durations: false,
metric: false,
metric: true,
})
}),
),