diff --git a/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_lockscreen.c b/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_lockscreen.c index 5b4efa12e..b949b0410 100644 --- a/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_lockscreen.c +++ b/applications/main/xtreme_app/scenes/xtreme_app_scene_interface_lockscreen.c @@ -82,6 +82,15 @@ static void xtreme_app_scene_interface_lockscreen_lockscreen_prompt_changed(Vari app->save_settings = true; } +static void + xtreme_app_scene_interface_lockscreen_lockscreen_transparent_changed(VariableItem* item) { + XtremeApp* app = variable_item_get_context(item); + bool value = variable_item_get_current_value_index(item); + variable_item_set_current_value_text(item, value ? "ON" : "OFF"); + XTREME_SETTINGS()->lockscreen_transparent = value; + app->save_settings = true; +} + void xtreme_app_scene_interface_lockscreen_on_enter(void* context) { XtremeApp* app = context; XtremeSettings* xtreme_settings = XTREME_SETTINGS(); @@ -162,6 +171,16 @@ void xtreme_app_scene_interface_lockscreen_on_enter(void* context) { variable_item_set_current_value_index(item, xtreme_settings->lockscreen_prompt); variable_item_set_current_value_text(item, xtreme_settings->lockscreen_prompt ? "ON" : "OFF"); + item = variable_item_list_add( + var_item_list, + "Transparent (see animation)", + 2, + xtreme_app_scene_interface_lockscreen_lockscreen_transparent_changed, + app); + variable_item_set_current_value_index(item, xtreme_settings->lockscreen_transparent); + variable_item_set_current_value_text( + item, xtreme_settings->lockscreen_transparent ? "ON" : "OFF"); + variable_item_list_set_enter_callback( var_item_list, xtreme_app_scene_interface_lockscreen_var_item_list_callback, app); diff --git a/applications/services/desktop/views/desktop_view_locked.c b/applications/services/desktop/views/desktop_view_locked.c index 69ace11ed..84adda9ec 100644 --- a/applications/services/desktop/views/desktop_view_locked.c +++ b/applications/services/desktop/views/desktop_view_locked.c @@ -94,7 +94,9 @@ void desktop_view_locked_draw_lockscreen(Canvas* canvas, void* m) { snprintf(date_str, 14, "%.2d-%.2d-%.4d", datetime.day, datetime.month, datetime.year); } - canvas_draw_icon(canvas, 0, 0 + y, &I_Lockscreen); + if(!xtreme_settings->lockscreen_transparent) { + canvas_draw_icon(canvas, 0, 0 + y, &I_Lockscreen); + } if(xtreme_settings->lockscreen_time) { canvas_set_font(canvas, FontBigNumbers); canvas_draw_str(canvas, 0, 64 + y, time_str); diff --git a/lib/xtreme/settings.c b/lib/xtreme/settings.c index 78e3fb058..9198161cb 100644 --- a/lib/xtreme/settings.c +++ b/lib/xtreme/settings.c @@ -19,6 +19,7 @@ XtremeSettings xtreme_settings = { .lockscreen_date = true, // ON .lockscreen_statusbar = true, // ON .lockscreen_prompt = true, // ON + .lockscreen_transparent = false, // OFF .battery_icon = BatteryIconBarPercent, // Bar % .statusbar_clock = false, // OFF .status_icons = true, // ON @@ -107,6 +108,10 @@ void XTREME_SETTINGS_LOAD() { x->lockscreen_prompt = b; } flipper_format_rewind(file); + if(flipper_format_read_bool(file, "lockscreen_transparent", &b, 1)) { + x->lockscreen_transparent = b; + } + flipper_format_rewind(file); if(flipper_format_read_uint32(file, "battery_icon", &u, 1)) { x->battery_icon = CLAMP(u, BatteryIconCount - 1U, 0U); } @@ -213,6 +218,7 @@ void XTREME_SETTINGS_SAVE() { flipper_format_write_bool(file, "lockscreen_date", &x->lockscreen_date, 1); flipper_format_write_bool(file, "lockscreen_statusbar", &x->lockscreen_statusbar, 1); flipper_format_write_bool(file, "lockscreen_prompt", &x->lockscreen_prompt, 1); + flipper_format_write_bool(file, "lockscreen_transparent", &x->lockscreen_transparent, 1); e = x->battery_icon; flipper_format_write_uint32(file, "battery_icon", &e, 1); flipper_format_write_bool(file, "statusbar_clock", &x->statusbar_clock, 1); diff --git a/lib/xtreme/xtreme.h b/lib/xtreme/xtreme.h index c60c4364f..3c09d9324 100644 --- a/lib/xtreme/xtreme.h +++ b/lib/xtreme/xtreme.h @@ -63,6 +63,7 @@ typedef struct { bool lockscreen_date; bool lockscreen_statusbar; bool lockscreen_prompt; + bool lockscreen_transparent; BatteryIcon battery_icon; bool statusbar_clock; bool status_icons;