From f73e81356209cacaaa58ab925ffaa80c3bd705b2 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Mon, 10 May 2021 09:53:04 +0200 Subject: [PATCH] minor fixes --- examples/widgets/roller/index.rst | 8 +++++++- examples/widgets/roller/lv_example_roller_2.c | 2 +- src/widgets/lv_table.c | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/examples/widgets/roller/index.rst b/examples/widgets/roller/index.rst index 2651b20dc..3aeac4dbc 100644 --- a/examples/widgets/roller/index.rst +++ b/examples/widgets/roller/index.rst @@ -4,7 +4,13 @@ C Simple Roller """""""""""""""" -.. lv_example:: lv_ex_widgets/lv_ex_roller/lv_ex_roller_1 +.. lv_example:: widgets/roller/lv_example_roller_1 + :language: c + +Styling the roller +"""""""""""""""""" + +.. lv_example:: widgets/roller/lv_example_roller_2 :language: c MicroPython diff --git a/examples/widgets/roller/lv_example_roller_2.c b/examples/widgets/roller/lv_example_roller_2.c index 55712b754..87388127f 100644 --- a/examples/widgets/roller/lv_example_roller_2.c +++ b/examples/widgets/roller/lv_example_roller_2.c @@ -8,7 +8,7 @@ static void event_handler(lv_event_t * e) if(code == LV_EVENT_VALUE_CHANGED) { char buf[32]; lv_roller_get_selected_str(obj, buf, sizeof(buf)); - LV_LOG_USER("Selected value: %s\n", buf); + LV_LOG_USER("Selected value: %s", buf); } } diff --git a/src/widgets/lv_table.c b/src/widgets/lv_table.c index af6998f02..15d4db898 100644 --- a/src/widgets/lv_table.c +++ b/src/widgets/lv_table.c @@ -689,7 +689,7 @@ static void draw_main(lv_event_t * e) lv_state_t cell_state = LV_STATE_DEFAULT; if(row == table->row_act && col == table->col_act) { - if(obj->state & LV_STATE_PRESSED) cell_state |= LV_STATE_PRESSED; + if(!(obj->state & LV_STATE_SCROLLED) && (obj->state & LV_STATE_PRESSED)) cell_state |= LV_STATE_PRESSED; if(obj->state & LV_STATE_FOCUSED) cell_state |= LV_STATE_FOCUSED; if(obj->state & LV_STATE_FOCUS_KEY) cell_state |= LV_STATE_FOCUS_KEY; if(obj->state & LV_STATE_EDITED) cell_state |= LV_STATE_EDITED;