Skip to content

Commit 7dfb324

Browse files
author
Greg Smith
committed
- fixed issues where the preset user text length was not handled properly.
- If the text length was set to maximum (31 characters + null terminator) then load from NVS failed - text box had the wrong max length, allow extra characters to be entered that got truncated - slight tweaks to 4.3B UI; larger font for preset user text, moved green tick in settings to corner away from sliders (matches 3.5")
1 parent 9ba374b commit 7dfb324

File tree

5 files changed

+13
-13
lines changed

5 files changed

+13
-13
lines changed

source/main/control.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2313,7 +2313,7 @@ static uint8_t __attribute__((unused)) LoadPresetUserText(uint16_t preset_index,
23132313
if (err == ESP_OK)
23142314
{
23152315
// read
2316-
required_size = MAX_PRESET_USER_TEXT_LENGTH - 1;
2316+
required_size = MAX_PRESET_USER_TEXT_LENGTH;
23172317
err = nvs_get_str(my_handle, key, text, &required_size);
23182318

23192319
// clamp text at max length and ensure its null terminated

source/main/ui_generated_480x320land/screens.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ void create_screen_screen1() {
243243
objects.ui_preset_details_text_area = obj;
244244
lv_obj_set_pos(obj, 8, 185);
245245
lv_obj_set_size(obj, 464, 67);
246-
lv_textarea_set_max_length(obj, 128);
246+
lv_textarea_set_max_length(obj, 31);
247247
lv_textarea_set_text(obj, "Preset Description...");
248248
lv_textarea_set_one_line(obj, false);
249249
lv_textarea_set_password_mode(obj, false);

source/main/ui_generated_800x480land/screens.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,15 +169,15 @@ void create_screen_screen1() {
169169
objects.ui_preset_details_text_area = obj;
170170
lv_obj_set_pos(obj, 14, 278);
171171
lv_obj_set_size(obj, 773, 104);
172-
lv_textarea_set_max_length(obj, 128);
172+
lv_textarea_set_max_length(obj, 31);
173173
lv_textarea_set_text(obj, "Preset Description...");
174174
lv_textarea_set_one_line(obj, false);
175175
lv_textarea_set_password_mode(obj, false);
176176
lv_obj_add_event_cb(obj, action_preset_description_pressed, LV_EVENT_PRESSED, (void *)0);
177177
lv_obj_clear_flag(obj, LV_OBJ_FLAG_SCROLLABLE|LV_OBJ_FLAG_SCROLL_CHAIN_HOR|LV_OBJ_FLAG_SCROLL_CHAIN_VER|LV_OBJ_FLAG_SCROLL_ELASTIC|LV_OBJ_FLAG_SCROLL_MOMENTUM|LV_OBJ_FLAG_SCROLL_ON_FOCUS|LV_OBJ_FLAG_SCROLL_WITH_ARROW);
178178
lv_obj_add_state(obj, LV_STATE_DISABLED);
179179
lv_obj_set_style_text_color(obj, lv_color_hex(0xff808080), LV_PART_MAIN | LV_STATE_DEFAULT);
180-
lv_obj_set_style_text_font(obj, &lv_font_montserrat_30, LV_PART_MAIN | LV_STATE_DEFAULT);
180+
lv_obj_set_style_text_font(obj, &lv_font_montserrat_36, LV_PART_MAIN | LV_STATE_DEFAULT);
181181
lv_obj_set_style_border_color(obj, lv_color_hex(0xff563f2a), LV_PART_MAIN | LV_STATE_DEFAULT);
182182
lv_obj_set_style_bg_color(obj, lv_color_hex(0xffffffff), LV_PART_MAIN | LV_STATE_DEFAULT);
183183
lv_obj_set_style_bg_opa(obj, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
@@ -2443,7 +2443,7 @@ void create_screen_settings() {
24432443
// ui_Closeimage
24442444
lv_obj_t *obj = lv_img_create(parent_obj);
24452445
objects.ui_closeimage = obj;
2446-
lv_obj_set_pos(obj, 354, 410);
2446+
lv_obj_set_pos(obj, 704, 405);
24472447
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
24482448
lv_img_set_src(obj, &img_tick);
24492449
lv_obj_add_event_cb(obj, action_close_settings_page, LV_EVENT_PRESSED, (void *)0);
@@ -5232,7 +5232,7 @@ void create_screen_val_settings() {
52325232
// ui_ValCloseimage
52335233
lv_obj_t *obj = lv_img_create(parent_obj);
52345234
objects.ui_val_closeimage = obj;
5235-
lv_obj_set_pos(obj, 354, 406);
5235+
lv_obj_set_pos(obj, 704, 405);
52365236
lv_obj_set_size(obj, LV_SIZE_CONTENT, LV_SIZE_CONTENT);
52375237
lv_img_set_src(obj, &img_tick);
52385238
lv_obj_add_event_cb(obj, action_close_settings_page, LV_EVENT_PRESSED, (void *)0);

ui_design_480x320land/Tonex_Controller_480_320.eez-project

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1201,7 +1201,7 @@
12011201
"oneLineMode": false,
12021202
"passwordMode": false,
12031203
"acceptedCharacters": "",
1204-
"maxTextLength": 128
1204+
"maxTextLength": 31
12051205
},
12061206
{
12071207
"objID": "c5acbd04-2a91-4da0-a470-cec66a14bdc7",

ui_design_800x480land/Tonex_Controller_800_480land.eez-project

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,7 @@
910910
"MAIN": {
911911
"DEFAULT": {
912912
"text_color": "808080",
913-
"text_font": "MONTSERRAT_30",
913+
"text_font": "MONTSERRAT_36",
914914
"border_color": "563F2A",
915915
"bg_color": "#FFFFFF",
916916
"bg_opa": 0
@@ -926,7 +926,7 @@
926926
"oneLineMode": false,
927927
"passwordMode": false,
928928
"acceptedCharacters": "",
929-
"maxTextLength": 128
929+
"maxTextLength": 31
930930
},
931931
{
932932
"objID": "12223d2e-5652-421b-bad3-faff2cb5fc6b",
@@ -11776,8 +11776,8 @@
1177611776
{
1177711777
"objID": "bae65739-be8c-4cf5-f502-b9b105d36067",
1177811778
"type": "LVGLImageWidget",
11779-
"left": 354,
11780-
"top": 410,
11779+
"left": 704,
11780+
"top": 405,
1178111781
"width": 87,
1178211782
"height": 70,
1178311783
"customInputs": [],
@@ -25016,8 +25016,8 @@
2501625016
{
2501725017
"objID": "d2793565-3886-41e7-f9ca-9582d42a2fea",
2501825018
"type": "LVGLImageWidget",
25019-
"left": 354,
25020-
"top": 406,
25019+
"left": 704,
25020+
"top": 405,
2502125021
"width": 87,
2502225022
"height": 70,
2502325023
"customInputs": [],

0 commit comments

Comments
 (0)