mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-05-13 04:48:35 -07:00
Add transparent lockscreen toggle
This commit is contained in:
@@ -82,6 +82,15 @@ static void xtreme_app_scene_interface_lockscreen_lockscreen_prompt_changed(Vari
|
|||||||
app->save_settings = true;
|
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) {
|
void xtreme_app_scene_interface_lockscreen_on_enter(void* context) {
|
||||||
XtremeApp* app = context;
|
XtremeApp* app = context;
|
||||||
XtremeSettings* xtreme_settings = XTREME_SETTINGS();
|
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_index(item, xtreme_settings->lockscreen_prompt);
|
||||||
variable_item_set_current_value_text(item, xtreme_settings->lockscreen_prompt ? "ON" : "OFF");
|
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(
|
variable_item_list_set_enter_callback(
|
||||||
var_item_list, xtreme_app_scene_interface_lockscreen_var_item_list_callback, app);
|
var_item_list, xtreme_app_scene_interface_lockscreen_var_item_list_callback, app);
|
||||||
|
|
||||||
|
|||||||
@@ -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);
|
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) {
|
if(xtreme_settings->lockscreen_time) {
|
||||||
canvas_set_font(canvas, FontBigNumbers);
|
canvas_set_font(canvas, FontBigNumbers);
|
||||||
canvas_draw_str(canvas, 0, 64 + y, time_str);
|
canvas_draw_str(canvas, 0, 64 + y, time_str);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ XtremeSettings xtreme_settings = {
|
|||||||
.lockscreen_date = true, // ON
|
.lockscreen_date = true, // ON
|
||||||
.lockscreen_statusbar = true, // ON
|
.lockscreen_statusbar = true, // ON
|
||||||
.lockscreen_prompt = true, // ON
|
.lockscreen_prompt = true, // ON
|
||||||
|
.lockscreen_transparent = false, // OFF
|
||||||
.battery_icon = BatteryIconBarPercent, // Bar %
|
.battery_icon = BatteryIconBarPercent, // Bar %
|
||||||
.statusbar_clock = false, // OFF
|
.statusbar_clock = false, // OFF
|
||||||
.status_icons = true, // ON
|
.status_icons = true, // ON
|
||||||
@@ -107,6 +108,10 @@ void XTREME_SETTINGS_LOAD() {
|
|||||||
x->lockscreen_prompt = b;
|
x->lockscreen_prompt = b;
|
||||||
}
|
}
|
||||||
flipper_format_rewind(file);
|
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)) {
|
if(flipper_format_read_uint32(file, "battery_icon", &u, 1)) {
|
||||||
x->battery_icon = CLAMP(u, BatteryIconCount - 1U, 0U);
|
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_date", &x->lockscreen_date, 1);
|
||||||
flipper_format_write_bool(file, "lockscreen_statusbar", &x->lockscreen_statusbar, 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_prompt", &x->lockscreen_prompt, 1);
|
||||||
|
flipper_format_write_bool(file, "lockscreen_transparent", &x->lockscreen_transparent, 1);
|
||||||
e = x->battery_icon;
|
e = x->battery_icon;
|
||||||
flipper_format_write_uint32(file, "battery_icon", &e, 1);
|
flipper_format_write_uint32(file, "battery_icon", &e, 1);
|
||||||
flipper_format_write_bool(file, "statusbar_clock", &x->statusbar_clock, 1);
|
flipper_format_write_bool(file, "statusbar_clock", &x->statusbar_clock, 1);
|
||||||
|
|||||||
@@ -63,6 +63,7 @@ typedef struct {
|
|||||||
bool lockscreen_date;
|
bool lockscreen_date;
|
||||||
bool lockscreen_statusbar;
|
bool lockscreen_statusbar;
|
||||||
bool lockscreen_prompt;
|
bool lockscreen_prompt;
|
||||||
|
bool lockscreen_transparent;
|
||||||
BatteryIcon battery_icon;
|
BatteryIcon battery_icon;
|
||||||
bool statusbar_clock;
|
bool statusbar_clock;
|
||||||
bool status_icons;
|
bool status_icons;
|
||||||
|
|||||||
Reference in New Issue
Block a user