scope_scene_about.c 1.6 KB

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