[FL-1850] Archive: limit name length in text input view #728

This commit is contained in:
its your bedtime 2021-09-28 19:18:06 +03:00 committed by GitHub
parent ec18c1a92a
commit 0126b3aba4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -259,7 +259,7 @@ const FlipperApplication FLIPPER_SETTINGS_APPS[] = {
{.app = power_settings_app, .name = "Power", .stack_size = 1024, .icon = NULL}, {.app = power_settings_app, .name = "Power", .stack_size = 1024, .icon = NULL},
#endif #endif
#ifdef APP_DESKTOP #ifdef SRV_DESKTOP
{.app = desktop_settings_app, .name = "Desktop", .stack_size = 1024, .icon = NULL}, {.app = desktop_settings_app, .name = "Desktop", .stack_size = 1024, .icon = NULL},
#endif #endif

View File

@ -4,6 +4,7 @@
#include "../helpers/archive_browser.h" #include "../helpers/archive_browser.h"
#define SCENE_RENAME_CUSTOM_EVENT (0UL) #define SCENE_RENAME_CUSTOM_EVENT (0UL)
#define MAX_TEXT_INPUT_LEN 22
void archive_scene_rename_text_input_callback(void* context) { void archive_scene_rename_text_input_callback(void* context) {
ArchiveApp* archive = (ArchiveApp*)context; ArchiveApp* archive = (ArchiveApp*)context;
@ -26,7 +27,7 @@ void archive_scene_rename_on_enter(void* context) {
archive_scene_rename_text_input_callback, archive_scene_rename_text_input_callback,
archive, archive,
archive->text_store, archive->text_store,
MAX_NAME_LEN, MAX_TEXT_INPUT_LEN,
false); false);
view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput); view_dispatcher_switch_to_view(archive->view_dispatcher, ArchiveViewTextInput);