WIP - integration - canvas folder moved

pull/3662/head
cepetr 1 month ago
parent 1be00d543c
commit 534e24c34d

@ -1,5 +1,7 @@
use crate::error::Error;
use crate::micropython::{buffer::get_buffer, obj::Obj};
use crate::{
error::Error,
micropython::{buffer::get_buffer, obj::Obj},
};
use crate::ui::{
component::{Component, Event, EventCtx, Never},

@ -1,8 +1,7 @@
use crate::ui::{
canvas::Canvas,
display::Color,
geometry::{Offset, Point, Rect},
shape::{DrawingCache, Renderer, Shape, ShapeClone},
shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
};
use without_alloc::alloc::LocalAllocLeakExt;

@ -1,8 +1,7 @@
use crate::ui::{
canvas::Canvas,
display::Color,
geometry::{Offset, Point, Rect},
shape::{DrawingCache, Renderer, Shape, ShapeClone},
shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
};
use without_alloc::alloc::LocalAllocLeakExt;

@ -1,8 +1,7 @@
use crate::ui::{
canvas::Canvas,
display::Color,
geometry::{Offset, Point, Rect},
shape::{DrawingCache, Renderer, Shape, ShapeClone},
shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
};
use without_alloc::alloc::LocalAllocLeakExt;

@ -1,8 +1,7 @@
use crate::ui::{
canvas::Canvas,
display::Color,
geometry::{Offset, Point, Rect},
shape::{DrawingCache, Renderer, Shape, ShapeClone},
shape::{Canvas, DrawingCache, Renderer, Shape, ShapeClone},
};
use without_alloc::alloc::LocalAllocLeakExt;

@ -1,8 +1,6 @@
#[cfg(feature = "micropython")]
use crate::micropython::buffer::StrBuffer;
use crate::ui::{
component::base::Component, constant::screen, model_tr::component::WelcomeScreen,
};
use crate::ui::{component::base::Component, constant::screen, model_tr::component::WelcomeScreen};
#[cfg(not(feature = "new_rendering"))]
use crate::ui::display;

@ -6,7 +6,6 @@ use crate::{
micropython::buffer::StrBuffer,
translations::TR,
ui::{
canvas::algo::PI4,
component::{
base::Never, Bar, Child, Component, ComponentExt, Empty, Event, EventCtx, Label, Split,
},
@ -143,8 +142,8 @@ where
let start = (self.value as i16 - 100) % 1000;
let end = (self.value as i16 + 100) % 1000;
let start = ((start as i32 * 8 * PI4 as i32) / 1000) as i16;
let end = ((end as i32 * 8 * PI4 as i32) / 1000) as i16;
let start = ((start as i32 * 8 * shape::PI4 as i32) / 1000) as i16;
let end = ((end as i32 * 8 * shape::PI4 as i32) / 1000) as i16;
shape::Circle::new(center, LOADER_OUTER)
.with_bg(inactive_color)

@ -4,7 +4,6 @@ use crate::{
time::{Duration, Instant},
ui::{
animation::Animation,
canvas::algo::PI4,
component::{Component, Event, EventCtx, Pad},
display::{self, toif::Icon, Color},
geometry::{Alignment2D, Offset, Rect},
@ -236,7 +235,7 @@ impl Component for Loader {
shape::Circle::new(center, constant::LOADER_OUTER)
.with_bg(style.loader_color)
.with_end_angle(((progress as i32 * PI4 as i32 * 8) / 1000) as i16)
.with_end_angle(((progress as i32 * shape::PI4 as i32 * 8) / 1000) as i16)
.render(target);
shape::Circle::new(center, constant::LOADER_INNER + 2)

@ -4,7 +4,6 @@ use crate::{
error::Error,
strutil::StringType,
ui::{
canvas::algo::PI4,
component::{
base::ComponentExt,
paginated::Paginate,
@ -134,11 +133,11 @@ where
let (start, end) = if self.indeterminate {
let start = (self.value as i16 - 100) % 1000;
let end = (self.value as i16 + 100) % 1000;
let start = ((start as i32 * 8 * PI4 as i32) / 1000) as i16;
let end = ((end as i32 * 8 * PI4 as i32) / 1000) as i16;
let start = ((start as i32 * 8 * shape::PI4 as i32) / 1000) as i16;
let end = ((end as i32 * 8 * shape::PI4 as i32) / 1000) as i16;
(start, end)
} else {
let end = ((self.value as i32 * 8 * PI4 as i32) / 1000) as i16;
let end = ((self.value as i32 * 8 * shape::PI4 as i32) / 1000) as i16;
(0, end)
};

@ -6,7 +6,10 @@ use crate::ui::{
shape::Renderer,
};
#[cfg(feature = "bootloader")]
use crate::ui::{display::{Icon, toif::Toif}, model_tt::theme::bootloader::DEVICE_NAME};
use crate::ui::{
display::{toif::Toif, Icon},
model_tt::theme::bootloader::DEVICE_NAME,
};
const TEXT_BOTTOM_MARGIN: i16 = 24; // matching the homescreen label margin
const ICON_TOP_MARGIN: i16 = 48;

@ -14,7 +14,6 @@ use crate::ui::display;
#[cfg(feature = "new_rendering")]
use crate::ui::{display::Color, shape::render_on_display};
#[cfg(not(feature = "micropython"))]
// SAFETY: Actually safe but see below
unsafe fn get_str(text: &str) -> &str {

Loading…
Cancel
Save