| 363 | } |
| 364 | |
| 365 | void PythonApp::refreshScriptList() { |
| 366 | if (!_panelScripts) return; |
| 367 | |
| 368 | // Remove old rows |
| 369 | for (int i = 0; i < MAX_SCRIPTS; ++i) { |
| 370 | if (_scriptRows[i]) { |
| 371 | lv_obj_delete(_scriptRows[i]); |
| 372 | _scriptRows[i] = nullptr; |
| 373 | _scriptLabels[i] = nullptr; |
| 374 | } |
| 375 | } |
| 376 | |
| 377 | // Create rows for each script |
| 378 | static constexpr int ROW_H = 28; |
| 379 | static constexpr int ROW_GAP = 2; |
| 380 | static constexpr int PAD = 6; |
| 381 | |
| 382 | for (int i = 0; i < _scriptCount; ++i) { |
| 383 | int ry = PAD + i * (ROW_H + ROW_GAP); |
| 384 | _scriptRows[i] = makePanel(_panelScripts, PAD, ry, SCREEN_W - 2 * PAD, ROW_H, COL_ROW_BG); |
| 385 | lv_obj_set_style_radius(_scriptRows[i], 4, LV_PART_MAIN); |
| 386 | lv_obj_set_style_border_width(_scriptRows[i], 1, LV_PART_MAIN); |
| 387 | lv_obj_set_style_border_color(_scriptRows[i], lv_color_hex(0xD1D1D1), LV_PART_MAIN); |
| 388 | |
| 389 | // Python file icon (emoji-like "py" tag) |
| 390 | makeLabel(_scriptRows[i], 6, (ROW_H - 12) / 2, "py", 0xF57F17, &stix_math_18); |
| 391 | |
| 392 | _scriptLabels[i] = makeLabel(_scriptRows[i], 28, (ROW_H - 12) / 2, |
| 393 | _scriptNames[i], 0x333333, &stix_math_18); |
| 394 | } |
| 395 | |
| 396 | if (_scriptCount == 0) { |
| 397 | makeLabel(_panelScripts, SCREEN_W / 2 - 50, CONTENT_H / 2 - 20, |
| 398 | "No scripts found", 0x999999, &lv_font_montserrat_14); |
| 399 | } |
| 400 | |
| 401 | refreshScriptFocus(); |
| 402 | } |
| 403 | |
| 404 | void PythonApp::refreshScriptFocus() { |
| 405 | for (int i = 0; i < _scriptCount; ++i) { |