flash_info_view: align content justified

This commit is contained in:
2026-08-30 08:17:22 +00:00
parent af964bcc37
commit 3d36885e11
+7 -2
View File
@@ -16,6 +16,7 @@ use embedded_graphics::{
pixelcolor::Rgb565, pixelcolor::Rgb565,
prelude::*, prelude::*,
primitives::Rectangle, primitives::Rectangle,
text::Text,
}; };
use alloc::format; use alloc::format;
@@ -34,7 +35,11 @@ impl Navigable for FlashInfoView {
peripherals: &Peripherals, peripherals: &Peripherals,
) -> impl core::future::Future<Output = Result<(), Box<dyn error::Error>>> + Send { ) -> impl core::future::Future<Output = Result<(), Box<dyn error::Error>>> + Send {
async move { async move {
let _style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE); outputs
.primary_display
.clear(Rgb565::BLACK)
.map_err(PrimaryDisplayError::from)?;
let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
let mut magic_bytes: [u8; MAGIC_REGION.size] = [0; MAGIC_REGION.size]; let mut magic_bytes: [u8; MAGIC_REGION.size] = [0; MAGIC_REGION.size];
peripherals peripherals
.store .store
@@ -55,7 +60,7 @@ impl Navigable for FlashInfoView {
let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE); let style = MonoTextStyle::new(&FONT_10X20, Rgb565::WHITE);
let textbox_style = TextBoxStyleBuilder::new() let textbox_style = TextBoxStyleBuilder::new()
.height_mode(HeightMode::FitToText) .height_mode(HeightMode::FitToText)
.alignment(HorizontalAlignment::Center) .alignment(HorizontalAlignment::Justified)
.build(); .build();
let display_area = outputs.primary_display.bounding_box(); let display_area = outputs.primary_display.bounding_box();