scope_scene_about.c 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #include "../scope_app_i.h"
  2. #include "../helpers/scope_types.h"
  3. void scope_scene_about_widget_callback(
  4. GuiButtonType result,
  5. InputType type,
  6. void* context) {
  7. ScopeApp* app = context;
  8. if(type == InputTypeShort) {
  9. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  10. }
  11. }
  12. void scope_scene_about_on_enter(void* context) {
  13. ScopeApp* app = context;
  14. FuriString* temp_str;
  15. temp_str = furi_string_alloc();
  16. furi_string_printf(temp_str, "\e#%s\n", "Information");
  17. furi_string_cat_printf(temp_str, "Version: %s\n", S_VERSION_APP);
  18. furi_string_cat_printf(temp_str, "Developed by: %s\n", S_DEVELOPED);
  19. furi_string_cat_printf(temp_str, "Github: %s\n\n", S_GITHUB);
  20. widget_add_text_box_element(
  21. app->widget,
  22. 0,
  23. 0,
  24. 128,
  25. 14,
  26. AlignCenter,
  27. AlignBottom,
  28. "\e#\e! \e!\n",
  29. false);
  30. widget_add_text_box_element(
  31. app->widget,
  32. 0,
  33. 2,
  34. 128,
  35. 14,
  36. AlignCenter,
  37. AlignBottom,
  38. "\e#\e! flipperscope \e!\n",
  39. false);
  40. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  41. furi_string_free(temp_str);
  42. view_dispatcher_switch_to_view(app->view_dispatcher, ScopeViewWidget);
  43. }
  44. bool scope_scene_about_on_event(void* context, SceneManagerEvent event) {
  45. ScopeApp* app = context;
  46. bool consumed = false;
  47. UNUSED(app);
  48. UNUSED(event);
  49. return consumed;
  50. }
  51. void scope_scene_about_on_exit(void* context) {
  52. ScopeApp* app = context;
  53. // Clear views
  54. widget_reset(app->widget);
  55. }