weebo_scene_acknowledgements.c 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #include "../weebo_i.h"
  2. #include <dolphin/dolphin.h>
  3. #include "../acknowledgements.h"
  4. void weebo_scene_acknowledgements_widget_callback(
  5. GuiButtonType result,
  6. InputType type,
  7. void* context) {
  8. Weebo* weebo = context;
  9. if(type == InputTypeShort) {
  10. view_dispatcher_send_custom_event(weebo->view_dispatcher, result);
  11. }
  12. }
  13. void weebo_scene_acknowledgements_on_enter(void* context) {
  14. Weebo* weebo = context;
  15. furi_string_reset(weebo->text_box_store);
  16. FuriString* str = weebo->text_box_store;
  17. furi_string_cat_printf(str, "%s\n", acknowledgements_text);
  18. text_box_set_font(weebo->text_box, TextBoxFontText);
  19. text_box_set_text(weebo->text_box, furi_string_get_cstr(weebo->text_box_store));
  20. view_dispatcher_switch_to_view(weebo->view_dispatcher, WeeboViewTextBox);
  21. }
  22. bool weebo_scene_acknowledgements_on_event(void* context, SceneManagerEvent event) {
  23. Weebo* weebo = context;
  24. bool consumed = false;
  25. if(event.type == SceneManagerEventTypeCustom) {
  26. if(event.event == GuiButtonTypeLeft) {
  27. consumed = scene_manager_previous_scene(weebo->scene_manager);
  28. }
  29. }
  30. return consumed;
  31. }
  32. void weebo_scene_acknowledgements_on_exit(void* context) {
  33. Weebo* weebo = context;
  34. // Clear views
  35. text_box_reset(weebo->text_box);
  36. }