My Marlin configs for Fabrikator Mini and CTC i3 Pro B
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

draw_about.cpp 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /**
  2. * Marlin 3D Printer Firmware
  3. * Copyright (c) 2020 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
  4. *
  5. * Based on Sprinter and grbl.
  6. * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
  7. *
  8. * This program is free software: you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License as published by
  10. * the Free Software Foundation, either version 3 of the License, or
  11. * (at your option) any later version.
  12. *
  13. * This program is distributed in the hope that it will be useful,
  14. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. * GNU General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  20. *
  21. */
  22. #include "../../../inc/MarlinConfigPre.h"
  23. #if HAS_TFT_LVGL_UI
  24. #include "draw_ui.h"
  25. #include <lv_conf.h>
  26. #include "../../../inc/MarlinConfig.h"
  27. extern lv_group_t *g;
  28. static lv_obj_t *scr;
  29. static lv_obj_t *fw_type, *board, *website, *uuid, *protocol;
  30. enum { ID_A_RETURN = 1 };
  31. static void event_handler(lv_obj_t *obj, lv_event_t event) {
  32. if (event != LV_EVENT_RELEASED) return;
  33. switch (obj->mks_obj_id) {
  34. case ID_A_RETURN:
  35. goto_previous_ui();
  36. break;
  37. }
  38. }
  39. void lv_draw_about() {
  40. scr = lv_screen_create(ABOUT_UI);
  41. lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN);
  42. board = lv_label_create(scr, BOARD_INFO_NAME);
  43. lv_obj_align(board, nullptr, LV_ALIGN_CENTER, 0, -80);
  44. fw_type = lv_label_create(scr, "Marlin " SHORT_BUILD_VERSION " (" STRING_DISTRIBUTION_DATE ")");
  45. lv_obj_align(fw_type, nullptr, LV_ALIGN_CENTER, 0, -50);
  46. website = lv_label_create(scr, WEBSITE_URL);
  47. lv_obj_align(website, nullptr, LV_ALIGN_CENTER, 0, -20);
  48. uuid = lv_label_create(scr, "UUID: " DEFAULT_MACHINE_UUID);
  49. lv_obj_align(uuid, nullptr, LV_ALIGN_CENTER, 0, 10);
  50. protocol = lv_label_create(scr, "Protocol: " PROTOCOL_VERSION);
  51. lv_obj_align(protocol, nullptr, LV_ALIGN_CENTER, 0, 40);
  52. }
  53. void lv_clear_about() {
  54. #if HAS_ROTARY_ENCODER
  55. if (gCfgItems.encoder_enable) lv_group_remove_all_objs(g);
  56. #endif
  57. lv_obj_del(scr);
  58. }
  59. #endif // HAS_TFT_LVGL_UI