Interrupts
This commit is contained in:
@ -21,32 +21,23 @@ use crate::views::icon::icon_box_view;
|
||||
pub fn menu_view(app_state: AppState) -> impl View<Rgb565> {
|
||||
VStack::new((
|
||||
HStack::new((
|
||||
main_menu_indicator(
|
||||
MenuIndicatorType::Temperature(app_state.sample.temperature),
|
||||
app_state.tendencies.temperature,
|
||||
),
|
||||
main_menu_indicator(
|
||||
MenuIndicatorType::Humidity(app_state.sample.humidity),
|
||||
app_state.tendencies.humidity,
|
||||
),
|
||||
main_menu_indicator(MenuIndicatorType::Temperature, app_state),
|
||||
main_menu_indicator(MenuIndicatorType::Humidity, app_state),
|
||||
))
|
||||
.with_spacing(2),
|
||||
HStack::new((
|
||||
main_menu_indicator(
|
||||
MenuIndicatorType::Co2(app_state.sample.eco2 as u32),
|
||||
app_state.tendencies.eco2,
|
||||
),
|
||||
main_menu_indicator(
|
||||
MenuIndicatorType::Voc(app_state.sample.tvoc as u32),
|
||||
app_state.tendencies.tvoc,
|
||||
),
|
||||
main_menu_indicator(MenuIndicatorType::Co2, app_state),
|
||||
main_menu_indicator(MenuIndicatorType::Voc, app_state),
|
||||
))
|
||||
.with_spacing(2),
|
||||
))
|
||||
.with_spacing(2)
|
||||
}
|
||||
|
||||
fn main_menu_indicator(indicator_type: MenuIndicatorType, tendency: Tendency) -> impl View<Rgb565> {
|
||||
fn main_menu_indicator(
|
||||
indicator_type: MenuIndicatorType,
|
||||
app_state: AppState,
|
||||
) -> impl View<Rgb565> {
|
||||
Rectangle
|
||||
.corner_radius(5)
|
||||
.stroked(FRAME_STROKE)
|
||||
@ -64,8 +55,8 @@ fn main_menu_indicator(indicator_type: MenuIndicatorType, tendency: Tendency) ->
|
||||
)),
|
||||
HStack::new((
|
||||
Spacer::default(),
|
||||
tendency_indicator(tendency),
|
||||
Text::new(indicator_type.get_value_str(), &PROFONT_24_POINT)
|
||||
tendency_indicator(indicator_type.get_tendency(&app_state)),
|
||||
Text::new(indicator_type.get_value_str(&app_state), &PROFONT_24_POINT)
|
||||
.foreground_color(MAIN_TEXT_COLOR),
|
||||
Text::new(
|
||||
indicator_type.get_corresponding_unit_string(),
|
||||
|
||||
Reference in New Issue
Block a user