summaryrefslogtreecommitdiff
path: root/fw/fe310/eos
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2021-02-26 23:17:59 +0100
committerUros Majstorovic <majstor@majstor.org>2021-02-26 23:17:59 +0100
commit9d91377659c1ffc0f23373dc0b2ff4edaafac6a8 (patch)
tree0ae2c77a942a787b5ea606bd0e75a4697ee3748c /fw/fe310/eos
parent5073075e39a1e35ab7408e3d325bf00a8e0a2230 (diff)
fixed tag opts for string and text widget
Diffstat (limited to 'fw/fe310/eos')
-rw-r--r--fw/fe310/eos/eve/widget/strw.c12
-rw-r--r--fw/fe310/eos/eve/widget/textw.c6
2 files changed, 11 insertions, 7 deletions
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; i<lineN; i++) {
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++;
}
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);