lightmeter_scene_about.c 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. #include "../../lightmeter.h"
  2. void lightmeter_scene_about_widget_callback(GuiButtonType result, InputType type, void* context) {
  3. LightMeterApp* app = context;
  4. UNUSED(app);
  5. UNUSED(result);
  6. UNUSED(type);
  7. if(type == InputTypeShort) {
  8. view_dispatcher_send_custom_event(app->view_dispatcher, result);
  9. }
  10. }
  11. void lightmeter_scene_about_on_enter(void* context) {
  12. LightMeterApp* 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", LM_VERSION_APP);
  17. furi_string_cat_printf(temp_str, "Developed by: %s\n", LM_DEVELOPED);
  18. furi_string_cat_printf(temp_str, "Github: %s\n\n", LM_GITHUB);
  19. furi_string_cat_printf(temp_str, "\e#%s\n", "Description");
  20. furi_string_cat_printf(
  21. temp_str,
  22. "Showing suggested camera\nsettings based on ambient\nlight or flash.\n\nInspired by a lightmeter\nproject by vpominchuk\n");
  23. widget_add_text_box_element(
  24. app->widget,
  25. 0,
  26. 0,
  27. 128,
  28. 14,
  29. AlignCenter,
  30. AlignBottom,
  31. "\e#\e! \e!\n",
  32. false);
  33. widget_add_text_box_element(
  34. app->widget,
  35. 0,
  36. 2,
  37. 128,
  38. 14,
  39. AlignCenter,
  40. AlignBottom,
  41. "\e#\e! Lightmeter \e!\n",
  42. false);
  43. widget_add_text_scroll_element(app->widget, 0, 16, 128, 50, furi_string_get_cstr(temp_str));
  44. furi_string_free(temp_str);
  45. view_dispatcher_switch_to_view(app->view_dispatcher, LightMeterAppViewAbout);
  46. }
  47. bool lightmeter_scene_about_on_event(void* context, SceneManagerEvent event) {
  48. LightMeterApp* app = context;
  49. bool consumed = false;
  50. UNUSED(app);
  51. UNUSED(event);
  52. return consumed;
  53. }
  54. void lightmeter_scene_about_on_exit(void* context) {
  55. LightMeterApp* app = context;
  56. // Clear views
  57. widget_reset(app->widget);
  58. }