From 9d91377659c1ffc0f23373dc0b2ff4edaafac6a8 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Fri, 26 Feb 2021 23:17:59 +0100 Subject: fixed tag opts for string and text widget --- fw/fe310/eos/eve/widget/strw.c | 12 +++++++----- fw/fe310/eos/eve/widget/textw.c | 6 ++++-- 2 files changed, 11 insertions(+), 7 deletions(-) (limited to 'fw/fe310') diff --git a/fw/fe310/eos/eve/widget/strw.c b/fw/fe310/eos/eve/widget/strw.c index c96608d..20d3292 100644 --- a/fw/fe310/eos/eve/widget/strw.c +++ b/fw/fe310/eos/eve/widget/strw.c @@ -16,6 +16,12 @@ #include "widget.h" #include "strw.h" +#define STRW_TOUCH_OPT EVE_TOUCH_OPT_TRACK | EVE_TOUCH_OPT_TRACK_X | EVE_TOUCH_OPT_TRACK_EXT_X | EVE_TOUCH_OPT_LPRESS + +#define STRW_TRACK_NONE 0 +#define STRW_TRACK_CRSR 1 +#define STRW_TRACK_TXT 2 + #define CH_BS 0x08 #define CH_DEL 0x7f #define CH_EOF 0x1a @@ -24,10 +30,6 @@ #define CH_CTRLC 0x03 #define CH_CTRLV 0x16 -#define STRW_TRACK_NONE 0 -#define STRW_TRACK_CRSR 1 -#define STRW_TRACK_TXT 2 - #define CHAR_VALID_INPUT(c) ((c >= 0x20) && (c < 0x7f)) int eve_strw_create(EVEStrWidget *widget, EVERect *g, EVEStrSpec *spec) { @@ -214,7 +216,7 @@ uint8_t eve_strw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) { _widget->tag0 = tag0; if (tag0 != EVE_TAG_NOTAG) { eve_cmd_dl(TAG(tag0)); - eve_touch_set_opt(tag0, EVE_TOUCH_OPT_LPRESS); + eve_touch_set_opt(tag0, STRW_TOUCH_OPT); tag0++; } _widget->tagN = tag0; diff --git a/fw/fe310/eos/eve/widget/textw.c b/fw/fe310/eos/eve/widget/textw.c index 20580dc..33eb2b0 100644 --- a/fw/fe310/eos/eve/widget/textw.c +++ b/fw/fe310/eos/eve/widget/textw.c @@ -16,6 +16,8 @@ #include "widget.h" #include "textw.h" +#define TEXTW_TOUCH_OPT EVE_TOUCH_OPT_TRACK | EVE_TOUCH_OPT_TRACK_XY | EVE_TOUCH_OPT_TRACK_EXT_XY | EVE_TOUCH_OPT_LPRESS + #define CH_BS 0x08 #define CH_DEL 0x7f #define CH_EOF 0x1a @@ -241,7 +243,7 @@ uint8_t eve_textw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) { for (i=line0; itagN != EVE_TAG_NOTAG) { eve_cmd_dl(TAG(_widget->tagN)); - eve_touch_set_opt(_widget->tagN, EVE_TOUCH_OPT_LPRESS); + eve_touch_set_opt(_widget->tagN, TEXTW_TOUCH_OPT); _widget->tagN++; } if (!s && c1 && (c1->line == i)) { @@ -280,7 +282,7 @@ uint8_t eve_textw_draw(EVEWidget *_widget, EVEPage *page, uint8_t tag0) { if (lineNvisible) { if (_widget->tagN != EVE_TAG_NOTAG) { eve_cmd_dl(TAG(_widget->tagN)); - eve_touch_set_opt(_widget->tagN, EVE_TOUCH_OPT_LPRESS); + eve_touch_set_opt(_widget->tagN, TEXTW_TOUCH_OPT); _widget->tagN++; } _draw_line(widget, page->v.window, lineN, 0, 0, 0, _widget->g.w, 0); -- cgit v1.2.3