| 603 | } |
| 604 | |
| 605 | void onTextInput(WidgetIndex widgetIndex, std::string_view text) override |
| 606 | { |
| 607 | if (text.empty()) |
| 608 | return; |
| 609 | |
| 610 | switch (widgetIndex) |
| 611 | { |
| 612 | case WIDX_THEMES_DUPLICATE_BUTTON: |
| 613 | case WIDX_THEMES_RENAME_BUTTON: |
| 614 | if (Platform::IsFilenameValid(text)) |
| 615 | { |
| 616 | if (ThemeGetIndexForName(std::string(text).c_str()) == SIZE_MAX) |
| 617 | { |
| 618 | if (widgetIndex == WIDX_THEMES_DUPLICATE_BUTTON) |
| 619 | { |
| 620 | ThemeDuplicate(std::string(text).c_str()); |
| 621 | } |
| 622 | else |
| 623 | { |
| 624 | ThemeRename(std::string(text).c_str()); |
| 625 | } |
| 626 | invalidate(); |
| 627 | } |
| 628 | else |
| 629 | { |
| 630 | ContextShowError(STR_THEMES_ERR_NAME_ALREADY_EXISTS, kStringIdNone, {}); |
| 631 | } |
| 632 | } |
| 633 | else |
| 634 | { |
| 635 | ContextShowError(STR_ERROR_INVALID_CHARACTERS, kStringIdNone, {}); |
| 636 | } |
| 637 | break; |
| 638 | } |
| 639 | } |
| 640 | |
| 641 | ScreenSize onScrollGetSize(int32_t scrollIndex) override |
| 642 | { |
nothing calls this directly
no test coverage detected