scope_scene_about.c 1.6 KB

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