fn interactive_area() -> impl Widget<AppState> {
    let text_box = TextBox::multiline()
        .with_text_color(Color::rgb8(0xf0, 0xf0, 0xea))
        .fix_size(INTERACTIVE_AREA_DIM, INTERACTIVE_AREA_DIM)
        .lens(AppState::text_input)
        .controller(EventLogger {
            filter: |event| matches!(event, Event::KeyDown(_) | Event::KeyUp(_)),
        });

    let mouse_box = SizedBox::empty()
        .fix_size(INTERACTIVE_AREA_DIM, INTERACTIVE_AREA_DIM)
        .background(CURSOR_BACKGROUND_COLOR)
        .rounded(5.0)
        .border(INTERACTIVE_AREA_BORDER, 1.0)
        .controller(EventLogger {
            filter: |event| {
                matches!(
                    event,
                    Event::MouseDown(_) | Event::MouseUp(_) | Event::Wheel(_)
                )
            },
        });

    Flex::row()
        .with_flex_spacer(1.0)
        .with_child(text_box)
        .with_flex_spacer(1.0)
        .with_child(mouse_box)
        .with_flex_spacer(1.0)
        .padding(10.0)
}
/// The top part of the application, that accepts keyboard and mouse input.
The top part of the application, that accepts keyboard and mouse input.
The top part of the application that accepts keyboard and mouse input .
fn interactive_area() -> impl Widget<AppState> {
    let text_box = TextBox::multiline()
        .with_text_color(Color::rgb8(0xf0, 0xf0, 0xea))
        .fix_size(INTERACTIVE_AREA_DIM, INTERACTIVE_AREA_DIM)
        .lens(AppState::text_input)
        .controller(EventLogger {
            filter: |event| matches!(event, Event::KeyDown(_) | Event::KeyUp(_)),
        });
    let mouse_box = SizedBox::empty()
        .fix_size(INTERACTIVE_AREA_DIM, INTERACTIVE_AREA_DIM)
        .background(CURSOR_BACKGROUND_COLOR)
        .rounded(5.0)
        .border(INTERACTIVE_AREA_BORDER, 1.0)
        .controller(EventLogger {
            filter: |event| {
                matches!(
                    event,
                    Event::MouseDown(_) | Event::MouseUp(_) | Event::Wheel(_)
                )
            },
        });
    Flex::row()
        .with_flex_spacer(1.0)
        .with_child(text_box)
        .with_flex_spacer(1.0)
        .with_child(mouse_box)
        .with_flex_spacer(1.0)
        .padding(10.0)
}
fn interactive_area ( ) -> impl Widget < AppState > { let text_box = TextBox :: multiline ( ) . with_text_color ( Color :: rgb8 ( 0xf0 , 0xf0 , 0xea ) ) . fix_size ( INTERACTIVE_AREA_DIM , INTERACTIVE_AREA_DIM ) . lens ( AppState :: text_input ) . controller ( EventLogger { filter : | event | matches ! ( event Event KeyDown ( ) Event KeyUp ( ) ) , } ) ; let mouse_box = SizedBox :: empty ( ) . fix_size ( INTERACTIVE_AREA_DIM , INTERACTIVE_AREA_DIM ) . background ( CURSOR_BACKGROUND_COLOR ) . rounded ( 5.0 ) . border ( INTERACTIVE_AREA_BORDER , 1.0 ) . controller ( EventLogger { filter : | event | { matches ! ( event Event MouseDown ( ) Event MouseUp ( ) Event Wheel ( ) ) } , } ) ; Flex :: row ( ) . with_flex_spacer ( 1.0 ) . with_child ( text_box ) . with_flex_spacer ( 1.0 ) . with_child ( mouse_box ) . with_flex_spacer ( 1.0 ) . padding ( 10.0 ) }
The top part of the application, that accepts keyboard and mouse input.
The top part of the application that accepts keyboard and mouse input .