-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Need for Drawing Events in lv_scale
#7334
Comments
Aren't it way simpler in with scale?
static const char * texts[] = {"a", "b", "c", "d", "e", "f", "g", NULL};
lv_scale_set_text_src(scale, texts);
lv_obj_t * needle_line = lv_line_create(scale_line);
//Later
lv_scale_set_line_needle_value(scale, line, 100, value);
lv_obj_set_style_line_color(needle_line, value_to_color(value), LV_PART_MAIN); |
Indeed, those DO handle what I was using them for.... In which case, the "need" for them drops to near zero.... |
Great! Note that you can still use the |
Excellent! In that case, I will close this since the need appears to have been filled in other ways! 👍 |
Problem to solve
When
lv_meter
went away in LVGL v9.0.0 in favor oflv_scale
, some important drawing events went away, and in previous firmware projects, I made heavy use of those events in a tachometer (rev counter in British), for example to:The drawing events sent by
lv_meter
were both powerful and valuable. They were well documented in the v8.4 documentation, and they came with vital drawing descriptor objects attached to the event (e
argument) which gave write access to thetext
pointer,color
and other things relevant to the drawing about to happen:It would be a powerful addition to
lv_scale
to implement these drawing events for the same reasons that they were powerful and valuable forlv_meter
.Success criteria
That the documentation of events for
lv_meter
in LVGL v8.4 will apply in full to the current version. Since it is a feature ADDITION, no API will be broken.Solution outline
lv_meter
and added tolv_scale
.lv_scale
.Rabbit holes
None known.
Testing
lv_scale
(or perhaps in a new example, so examples don't get too complex), demonstrate changing actual text and color of major-tick labels, andusing these drawing events.
Teaching
lv_scale
.Considerations
The code that populated the descriptors for the documented in events in
lv_meter
were quite straightforward and can be copied nearly verbatim if the drawing descriptors have not changed between LVGL v8.4 and v9.3.The text was updated successfully, but these errors were encountered: