rotary encoder velocity: use a custom LVGL flag to signal support (#66)
This commit is contained in:
@@ -86,3 +86,4 @@
|
||||
#define COLOR_VAL(flags) ((flags) >> 16u)
|
||||
#define COLOR_MASK(flags) ((flags) & 0xFFFF0000u)
|
||||
|
||||
#define LV_OBJ_FLAG_ENCODER_ACCEL LV_OBJ_FLAG_USER_1
|
||||
|
||||
+3
@@ -73,6 +73,9 @@ void MenuBody::onDrawEnd(uint16_t row, uint16_t col, lv_obj_draw_part_dsc_t* dsc
|
||||
MenuBody::MenuBody(Window * parent, const rect_t & rect):
|
||||
TableField(parent, rect)
|
||||
{
|
||||
// Allow encoder acceleration
|
||||
lv_obj_add_flag(lvobj, LV_OBJ_FLAG_ENCODER_ACCEL);
|
||||
|
||||
setColumnCount(1);
|
||||
setColumnWidth(0, rect.w);
|
||||
|
||||
|
||||
@@ -45,6 +45,9 @@ NumberEdit::NumberEdit(Window* parent, const rect_t& rect, int vmin, int vmax,
|
||||
std::move(setValue), windowFlags, textFlags,
|
||||
field_edit_create)
|
||||
{
|
||||
// Allow encoder acceleration
|
||||
lv_obj_add_flag(lvobj, LV_OBJ_FLAG_ENCODER_ACCEL);
|
||||
|
||||
// properties
|
||||
lv_obj_set_scrollbar_mode(lvobj, LV_SCROLLBAR_MODE_OFF);
|
||||
lv_textarea_set_password_mode(lvobj, false);
|
||||
|
||||
Reference in New Issue
Block a user