mirror of
https://github.com/Next-Flip/Momentum-Firmware.git
synced 2026-04-24 03:29:57 -07:00
Format
This commit is contained in:
@@ -12,7 +12,8 @@ static void xtreme_app_scene_misc_rename_text_input_callback(void* context) {
|
||||
view_dispatcher_send_custom_event(app->view_dispatcher, TextInputResultOk);
|
||||
}
|
||||
|
||||
static bool xtreme_app_scene_misc_rename_validator(const char* text, FuriString* error, void* context) {
|
||||
static bool
|
||||
xtreme_app_scene_misc_rename_validator(const char* text, FuriString* error, void* context) {
|
||||
UNUSED(context);
|
||||
|
||||
for(; *text; ++text) {
|
||||
|
||||
@@ -303,7 +303,8 @@ bool desktop_lock_menu_input_callback(InputEvent* event, void* context) {
|
||||
desktop_event = DesktopLockMenuEventXtreme;
|
||||
break;
|
||||
case DesktopLockMenuIndexVolume:
|
||||
desktop_event = stealth_mode ? DesktopLockMenuEventStealthModeOff : DesktopLockMenuEventStealthModeOn;
|
||||
desktop_event = stealth_mode ? DesktopLockMenuEventStealthModeOff :
|
||||
DesktopLockMenuEventStealthModeOn;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
||||
@@ -141,24 +141,24 @@ void canvas_set_font(Canvas* canvas, Font font) {
|
||||
furi_assert(canvas);
|
||||
u8g2_SetFontMode(&canvas->fb, 1);
|
||||
switch(font) {
|
||||
case FontPrimary:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_helvB08_tr);
|
||||
break;
|
||||
case FontSecondary:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_haxrcorp4089_tr);
|
||||
break;
|
||||
case FontKeyboard:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_profont11_mr);
|
||||
break;
|
||||
case FontBigNumbers:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_profont22_tn);
|
||||
break;
|
||||
case FontBatteryPercent:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_5x7_tf); //u8g2_font_micro_tr);
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
break;
|
||||
case FontPrimary:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_helvB08_tr);
|
||||
break;
|
||||
case FontSecondary:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_haxrcorp4089_tr);
|
||||
break;
|
||||
case FontKeyboard:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_profont11_mr);
|
||||
break;
|
||||
case FontBigNumbers:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_profont22_tn);
|
||||
break;
|
||||
case FontBatteryPercent:
|
||||
u8g2_SetFont(&canvas->fb, u8g2_font_5x7_tf); //u8g2_font_micro_tr);
|
||||
break;
|
||||
default:
|
||||
furi_crash(NULL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -373,10 +373,12 @@ static void text_input_handle_up(TextInput* text_input, TextInputModel* model) {
|
||||
if(model->selected_row > 0) {
|
||||
model->selected_row--;
|
||||
if(model->selected_row == 0 &&
|
||||
model->selected_column > get_row_size(keyboards[model->selected_keyboard], model->selected_row) - 6) {
|
||||
model->selected_column >
|
||||
get_row_size(keyboards[model->selected_keyboard], model->selected_row) - 6) {
|
||||
model->selected_column = model->selected_column + 1;
|
||||
}
|
||||
if(model->selected_row == 1 && model->selected_keyboard == symbol_keyboard.keyboard_index) {
|
||||
if(model->selected_row == 1 &&
|
||||
model->selected_keyboard == symbol_keyboard.keyboard_index) {
|
||||
if(model->selected_column > 5)
|
||||
model->selected_column += 2;
|
||||
else if(model->selected_column > 1)
|
||||
@@ -395,10 +397,12 @@ static void text_input_handle_down(TextInput* text_input, TextInputModel* model)
|
||||
} else if(model->selected_row < keyboard_row_count - 1) {
|
||||
model->selected_row++;
|
||||
if(model->selected_row == 1 &&
|
||||
model->selected_column > get_row_size(keyboards[model->selected_keyboard], model->selected_row) - 4) {
|
||||
model->selected_column >
|
||||
get_row_size(keyboards[model->selected_keyboard], model->selected_row) - 4) {
|
||||
model->selected_column = model->selected_column - 1;
|
||||
}
|
||||
if(model->selected_row == 2 && model->selected_keyboard == symbol_keyboard.keyboard_index) {
|
||||
if(model->selected_row == 2 &&
|
||||
model->selected_keyboard == symbol_keyboard.keyboard_index) {
|
||||
if(model->selected_column > 7)
|
||||
model->selected_column -= 2;
|
||||
else if(model->selected_column > 1)
|
||||
@@ -688,15 +692,11 @@ void text_input_set_result_callback(
|
||||
true);
|
||||
}
|
||||
|
||||
void text_input_set_minimum_length(
|
||||
TextInput* text_input,
|
||||
size_t minimum_length) {
|
||||
void text_input_set_minimum_length(TextInput* text_input, size_t minimum_length) {
|
||||
with_view_model(
|
||||
text_input->view,
|
||||
TextInputModel * model,
|
||||
{
|
||||
model->minimum_length = minimum_length;
|
||||
},
|
||||
{ model->minimum_length = minimum_length; },
|
||||
true);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,9 +70,7 @@ void text_input_set_validator(
|
||||
TextInputValidatorCallback callback,
|
||||
void* callback_context);
|
||||
|
||||
void text_input_set_minimum_length(
|
||||
TextInput* text_input,
|
||||
size_t minimum_length);
|
||||
void text_input_set_minimum_length(TextInput* text_input, size_t minimum_length);
|
||||
|
||||
TextInputValidatorCallback text_input_get_validator_callback(TextInput* text_input);
|
||||
|
||||
|
||||
@@ -228,8 +228,8 @@ static void draw_battery(Canvas* canvas, PowerInfo* info, int x, int y) {
|
||||
value,
|
||||
sizeof(value),
|
||||
"%lu.%luV",
|
||||
(uint32_t)(info->voltage_battery_charge_limit),
|
||||
(uint32_t)(info->voltage_battery_charge_limit * 10) % 10);
|
||||
(uint32_t)(info->voltage_battery_charge_limit),
|
||||
(uint32_t)(info->voltage_battery_charge_limit * 10) % 10);
|
||||
} else {
|
||||
snprintf(header, sizeof(header), "Charged!");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user