scope_scene_about.c 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  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, "Version: %s\n", S_VERSION_APP);
  14. furi_string_cat_printf(temp_str, "Developed by: %s\n", S_DEVELOPED);
  15. furi_string_cat_printf(temp_str, "Github: %s\n\n", S_GITHUB);
  16. widget_add_text_box_element(
  17. app->widget,
  18. 0,
  19. 0,
  20. 128,
  21. 14,
  22. AlignCenter,
  23. AlignBottom,
  24. "\e#\e! \e!\n",
  25. false);
  26. widget_add_text_box_element(
  27. app->widget,
  28. 0,
  29. 2,
  30. 128,
  31. 14,
  32. AlignCenter,
  33. AlignBottom,
  34. "\e#\e! flipperscope \e!\n",
  35. false);
  36. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  37. furi_string_free(temp_str);
  38. view_dispatcher_switch_to_view(app->view_dispatcher, ScopeViewWidget);
  39. }
  40. bool scope_scene_about_on_event(void* context, SceneManagerEvent event) {
  41. ScopeApp* app = context;
  42. bool consumed = false;
  43. UNUSED(app);
  44. UNUSED(event);
  45. return consumed;
  46. }
  47. void scope_scene_about_on_exit(void* context) {
  48. ScopeApp* app = context;
  49. // Clear views
  50. widget_reset(app->widget);
  51. }