forked from ClemensElflein/CoverUI
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d8e2654
commit 0004dc0
Showing
4 changed files
with
708 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/** | ||
* @file WidgetTextTicker.hpp | ||
* @author Apehaenger ([email protected]) | ||
* @brief Tiny class/wrapper for a text-ticker, which get displayed for mower status messages (as LVGL label + anim) for OpenMower https://github.com/ClemensElflein/OpenMower | ||
* @version 0.1 | ||
* @date 2023-09-12 | ||
* | ||
* @copyright Copyright (c) 2023 | ||
*/ | ||
#ifndef __WIDGETTEXTTICKER_HPP | ||
#define __WIDGETTEXTTICKER_HPP | ||
|
||
#include <Arduino.h> | ||
#include <lvgl.h> | ||
#include "LEDcontrol.h" | ||
|
||
LV_FONT_DECLARE(PerfectPixel_20); | ||
|
||
namespace display | ||
{ | ||
class WidgetTextTicker | ||
{ | ||
public: | ||
WidgetTextTicker(lv_align_t align, lv_coord_t x_ofs, lv_coord_t y_ofs, lv_coord_t w) | ||
{ | ||
label = lv_label_create(lv_scr_act()); | ||
//lv_obj_set_style_text_color(lv_scr_act(), lv_color_hex(0xffffff), LV_PART_MAIN); | ||
lv_obj_set_style_text_align(label, LV_TEXT_ALIGN_CENTER, 0); | ||
lv_obj_set_style_text_font(label, &PerfectPixel_20, LV_PART_MAIN); | ||
lv_obj_align(label, align, x_ofs, y_ofs); | ||
lv_obj_set_width(label, w); | ||
lv_label_set_long_mode(label, LV_LABEL_LONG_SCROLL_CIRCULAR); | ||
} | ||
|
||
void set_text(const char *t_text) | ||
{ | ||
lv_label_set_text(label, t_text); | ||
} | ||
|
||
private: | ||
lv_obj_t *label; | ||
}; | ||
} // namespace display | ||
|
||
#endif // __WIDGETTEXTTICKER_HPP |
Oops, something went wrong.