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:
@@ -214,11 +214,18 @@ void desktop_animation_activate(DesktopAnimation* animation) {
|
||||
}
|
||||
}
|
||||
|
||||
static const Icon* desktop_animation_get_current_idle_animation(DesktopAnimation* animation) {
|
||||
const Icon* active_icon = animation->current->active->icon;
|
||||
const Icon* basic_icon = animation->current->basic->icon;
|
||||
return (animation->state == DesktopAnimationStateActive && active_icon) ? active_icon :
|
||||
basic_icon;
|
||||
static const Icon* desktop_animation_get_current_idle_animation(
|
||||
DesktopAnimation* animation,
|
||||
bool* status_bar_background_black) {
|
||||
const ActiveAnimation* active = animation->current->active;
|
||||
const BasicAnimation* basic = animation->current->basic;
|
||||
if(animation->state == DesktopAnimationStateActive && active->icon) {
|
||||
*status_bar_background_black = active->black_status_bar;
|
||||
return active->icon;
|
||||
} else {
|
||||
*status_bar_background_black = basic->black_status_bar;
|
||||
return basic->icon;
|
||||
}
|
||||
}
|
||||
|
||||
// Every time somebody starts 'desktop_animation_get_animation()'
|
||||
@@ -227,7 +234,9 @@ static const Icon* desktop_animation_get_current_idle_animation(DesktopAnimation
|
||||
// 3) check if the SD card is empty
|
||||
// 4) if all false - get idle animation
|
||||
|
||||
const Icon* desktop_animation_get_animation(DesktopAnimation* animation) {
|
||||
const Icon* desktop_animation_get_animation(
|
||||
DesktopAnimation* animation,
|
||||
bool* status_bar_background_black) {
|
||||
Dolphin* dolphin = furi_record_open("dolphin");
|
||||
Storage* storage = furi_record_open("storage");
|
||||
const Icon* icon = NULL;
|
||||
@@ -272,7 +281,10 @@ const Icon* desktop_animation_get_animation(DesktopAnimation* animation) {
|
||||
}
|
||||
|
||||
if(!icon) {
|
||||
icon = desktop_animation_get_current_idle_animation(animation);
|
||||
icon =
|
||||
desktop_animation_get_current_idle_animation(animation, status_bar_background_black);
|
||||
} else {
|
||||
status_bar_background_black = false;
|
||||
}
|
||||
|
||||
furi_record_close("storage");
|
||||
|
@@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <gui/icon.h>
|
||||
|
||||
@@ -22,11 +23,13 @@ struct BasicAnimation {
|
||||
uint16_t duration; // sec
|
||||
uint16_t active_cooldown;
|
||||
uint8_t weight;
|
||||
bool black_status_bar;
|
||||
uint16_t butthurt_level_mask;
|
||||
};
|
||||
|
||||
struct ActiveAnimation {
|
||||
const Icon* icon;
|
||||
bool black_status_bar;
|
||||
uint16_t duration; // sec
|
||||
};
|
||||
|
||||
@@ -49,7 +52,8 @@ DesktopAnimationState desktop_animation_handle_right(DesktopAnimation* animation
|
||||
|
||||
void desktop_animation_start_oneshot_levelup(DesktopAnimation* animation);
|
||||
|
||||
const Icon* desktop_animation_get_animation(DesktopAnimation* animation);
|
||||
const Icon*
|
||||
desktop_animation_get_animation(DesktopAnimation* animation, bool* status_bar_background_black);
|
||||
const Icon* desktop_animation_get_oneshot_frame(DesktopAnimation* animation);
|
||||
|
||||
void desktop_start_new_idle_animation(DesktopAnimation* animation);
|
||||
|
@@ -33,6 +33,7 @@ static const ActiveAnimation animation_TV_active = {
|
||||
|
||||
static const BasicAnimation animation_sleep = {
|
||||
.icon = &A_Sleep_128x51,
|
||||
.black_status_bar = true,
|
||||
.duration = COMMON_BASIC_DURATION,
|
||||
.weight = COMMON_WEIGHT,
|
||||
.active_cooldown = COMMON_ACTIVE_COOLDOWN,
|
||||
@@ -43,6 +44,7 @@ static const BasicAnimation animation_sleep = {
|
||||
|
||||
static const ActiveAnimation animation_sleep_active = {
|
||||
.icon = &A_SleepActive_128x51,
|
||||
.black_status_bar = true,
|
||||
.duration = COMMON_ACTIVE_DURATION(2),
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user