1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-23 05:40:57 +00:00

refactor(core/rust): add comments in frame.rs

This commit is contained in:
matejcik 2024-09-11 10:36:14 +02:00 committed by matejcik
parent 85d699a42d
commit a159ea133a

View File

@ -329,6 +329,7 @@ where
.render_swipe_cover(target, self.bounds);
}
}
fn frame_event(
horizontal_swipe: &mut HorizontalSwipe,
swipe_config: SwipeConfig,
@ -337,12 +338,16 @@ fn frame_event(
ctx: &mut EventCtx,
event: Event,
) -> Option<FlowMsg> {
// horizontal_swipe does not return any message
horizontal_swipe.event(event, swipe_config);
// msg type of footer is Never, so this should never return a value
let none = footer.event(ctx, event);
debug_assert!(none.is_none());
footer.event(ctx, event);
// msg type of header is FlowMsg, which will be the return value
header.event(ctx, event)
}
fn frame_place(header: &mut Header, footer: &mut Option<Footer>, bounds: Rect) -> Rect {
let (mut header_area, mut content_area) = bounds.split_top(TITLE_HEIGHT);
content_area = content_area.inset(Insets::top(theme::SPACING));