Fix out of screen drawings (#842)
* Fix lock screen menu * Fix pin setup in lock menu * Desktop GUI layer on FS, black status bar * Desktop: fix spelling * Fix first start screen * Fix status bar drawing Co-authored-by: Aleksandr Kutuzov <alleteam@gmail.com>
This commit is contained in:
@@ -22,7 +22,10 @@ void desktop_main_reset_hint(DesktopMainView* main_view) {
|
||||
});
|
||||
}
|
||||
|
||||
void desktop_main_switch_dolphin_animation(DesktopMainView* main_view, const Icon* icon) {
|
||||
void desktop_main_switch_dolphin_animation(
|
||||
DesktopMainView* main_view,
|
||||
const Icon* icon,
|
||||
bool status_bar_background_black) {
|
||||
with_view_model(
|
||||
main_view->view, (DesktopMainViewModel * model) {
|
||||
if(model->animation) icon_animation_free(model->animation);
|
||||
@@ -30,6 +33,7 @@ void desktop_main_switch_dolphin_animation(DesktopMainView* main_view, const Ico
|
||||
view_tie_icon_animation(main_view->view, model->animation);
|
||||
icon_animation_start(model->animation);
|
||||
model->icon = NULL;
|
||||
model->status_bar_background_black = status_bar_background_black;
|
||||
return true;
|
||||
});
|
||||
}
|
||||
@@ -49,15 +53,18 @@ void desktop_main_render(Canvas* canvas, void* model) {
|
||||
DesktopMainViewModel* m = model;
|
||||
uint32_t now = osKernelGetTickCount();
|
||||
|
||||
if(m->status_bar_background_black) {
|
||||
canvas_draw_box(canvas, 0, 0, GUI_STATUS_BAR_WIDTH, GUI_STATUS_BAR_HEIGHT);
|
||||
}
|
||||
if(m->icon) {
|
||||
canvas_draw_icon(canvas, 0, 0, m->icon);
|
||||
canvas_draw_icon(canvas, 0, 0 + STATUS_BAR_Y_SHIFT, m->icon);
|
||||
} else if(m->animation) {
|
||||
canvas_draw_icon_animation(canvas, 0, 0, m->animation);
|
||||
canvas_draw_icon_animation(canvas, 0, 0 + STATUS_BAR_Y_SHIFT, m->animation);
|
||||
}
|
||||
|
||||
if(now < m->hint_expire_at) {
|
||||
canvas_set_font(canvas, FontPrimary);
|
||||
elements_multiline_text_framed(canvas, 42, 30, "Unlocked");
|
||||
elements_multiline_text_framed(canvas, 42, 30 + STATUS_BAR_Y_SHIFT, "Unlocked");
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user