Add component trait and vsplit
This commit is contained in:
+7
-8
@@ -1,5 +1,5 @@
|
||||
use embedded_components::{
|
||||
Calendar, ComponentStyle, Gauge, List, ListItem, ListItemData, ScrollingCalendar,
|
||||
Calendar, ComponentStyle, Gauge, List, ListItem, ListItemData, ScrollingCalendar, VSplit,
|
||||
};
|
||||
use embedded_graphics::{
|
||||
pixelcolor::{raw::RawU2, BinaryColor, Rgb888},
|
||||
@@ -85,8 +85,6 @@ fn main() -> Result<(), core::convert::Infallible> {
|
||||
//calendar.draw(&mut display)?;
|
||||
|
||||
let list = List {
|
||||
top_left: Point::new(320, 0),
|
||||
size: Size::new(280, 448),
|
||||
style: calendar_style.clone(),
|
||||
items_shown: 10,
|
||||
list_items: vec![
|
||||
@@ -94,18 +92,19 @@ fn main() -> Result<(), core::convert::Infallible> {
|
||||
ListItemData::new("O", "Other test task"),
|
||||
],
|
||||
};
|
||||
list.draw(&mut display)?;
|
||||
//list.draw(&mut display)?;
|
||||
|
||||
let calendar_week = ScrollingCalendar {
|
||||
top_left: Point::new(0, 0),
|
||||
size: Size::new(320, 448),
|
||||
style: calendar_style,
|
||||
day: chrono::Local::now().naive_local().date(),
|
||||
//.checked_add_signed(chrono::Duration::days(28 * 4 * 0 - 14))
|
||||
//.unwrap(),
|
||||
weeks: 5,
|
||||
prev_weeks: 2,
|
||||
next_weeks: 5,
|
||||
};
|
||||
calendar_week.draw(&mut display)?;
|
||||
//calendar_week.draw(&mut display)?;
|
||||
|
||||
VSplit::new(calendar_week, list).draw(&mut display)?;
|
||||
|
||||
let output_settings = OutputSettingsBuilder::new()
|
||||
.theme(BinaryColorTheme::Default)
|
||||
|
||||
Reference in New Issue
Block a user