pub struct Layout {
pub font: &'static MonoFont<'static>,
pub left: i32,
pub top: i32,
pub row_pitch: i32,
pub rows: usize,
pub size: Size,
pub battery: BatteryIconMetrics,
pub overflow: Overflow,
pub controls: Controls,
}Expand description
A board’s panel and controls.
Everything the renderer needs to place a row of text and the battery indicator, plus which gestures to name in the hints. A board picks one of the constants — or writes its own if its panel is neither of the two shapes in the class today — and overrides the fields its hardware disagrees about:
const LAYOUT: Layout = Layout {
controls: Controls::Dpad,
..Layout::OLED_128X64
};Fields§
§font: &'static MonoFont<'static>§left: i32Left margin for row text.
top: i32Top of row 0’s glyph band.
row_pitch: i32Distance between the tops of consecutive rows.
rows: usizeHow many rows fit on the panel.
size: Size§battery: BatteryIconMetrics§overflow: OverflowHow this panel says a list continues past what it can draw.
controls: ControlsWhat the user drives it with.
Implementations§
Source§impl Layout
impl Layout
Sourcepub const OLED_128X64: Self
pub const OLED_128X64: Self
128×64 OLED: five rows of FONT_6X10. Shared by the Wio Tracker
L1’s SH1106 and the Heltec V3’s SSD1306.
Sourcepub const EPD_200X200: Self
pub const EPD_200X200: Self
200×200 e-paper: seven rows of FONT_10X20. The T-Echo’s SSD1681.
Sourcepub fn row_rect(&self, row: usize) -> Rectangle
pub fn row_rect(&self, row: usize) -> Rectangle
The full-width band row occupies.
A highlight fills this rather than the glyph cells, so it reads as a solid bar rather than as emphasized text.
Sourcepub fn battery_zone(&self) -> Rectangle
pub fn battery_zone(&self) -> Rectangle
The rectangle the battery indicator owns, right-aligned on row 0.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Layout
impl !RefUnwindSafe for Layout
impl Send for Layout
impl Sync for Layout
impl Unpin for Layout
impl !UnwindSafe for Layout
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)