summaryrefslogtreecommitdiff
path: root/fw/fe310/eos/eve/widget/textw.c
diff options
context:
space:
mode:
authorUros Majstorovic <majstor@majstor.org>2022-09-04 18:16:20 +0200
committerUros Majstorovic <majstor@majstor.org>2022-09-04 18:16:20 +0200
commitec0caa569b356f186e87c13e50550ca1b807dde6 (patch)
treeab07671a8aed9c573fe20d2d100be0ab1c5e68a7 /fw/fe310/eos/eve/widget/textw.c
parent7f8e473ac12191ca4449de96033e2acda07dc4c4 (diff)
eve support when i2s is running
Diffstat (limited to 'fw/fe310/eos/eve/widget/textw.c')
-rw-r--r--fw/fe310/eos/eve/widget/textw.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/fw/fe310/eos/eve/widget/textw.c b/fw/fe310/eos/eve/widget/textw.c
index 70a1e06..a4114ee 100644
--- a/fw/fe310/eos/eve/widget/textw.c
+++ b/fw/fe310/eos/eve/widget/textw.c
@@ -81,7 +81,7 @@ void eve_textw_destroy(EVEWidget *_widget) {
eve_free(widget->text);
}
-static void set_focus(EVETextWidget *widget, EVETextCursor *cursor) {
+static void show_rect(EVETextWidget *widget, EVETextCursor *cursor) {
EVEWidget *_widget = &widget->w;
EVERect focus;
@@ -89,7 +89,7 @@ static void set_focus(EVETextWidget *widget, EVETextCursor *cursor) {
focus.y = _widget->g.y + cursor->line * widget->font->h;
focus.w = _widget->g.w;
focus.h = 2 * widget->font->h;
- eve_widget_set_focus(_widget, &focus);
+ eve_page_show_rect(_widget->page, &focus);
}
static EVETextCursor *cursor_prox(EVETextWidget *widget, EVETextCursor *cursor, EVETouch *touch, short *dx, short *dl) {
@@ -280,7 +280,7 @@ int eve_textw_touch(EVEWidget *_widget, EVETouch *touch, uint16_t evt) {
if ((evt & EVE_TOUCH_ETYPE_POINT_UP) && !(touch->eevt & (EVE_TOUCH_EETYPE_TRACK_XY | EVE_TOUCH_EETYPE_ABORT | EVE_TOUCH_EETYPE_LPRESS))) {
eve_textw_cursor_set(widget, &widget->cursor1, touch->tag_up, eve_page_x(page, touch->x0));
if (widget->cursor2.on) eve_textw_cursor_clear(widget, &widget->cursor2);
- set_focus(widget, &widget->cursor1);
+ show_rect(widget, &widget->cursor1);
ret = 1;
}
}
@@ -291,7 +291,6 @@ int eve_textw_touch(EVEWidget *_widget, EVETouch *touch, uint16_t evt) {
widget->track.dl = 0;
}
- if (ret) eve_widget_set_focus(_widget, NULL);
return ret;
}
@@ -405,11 +404,11 @@ void eve_textw_putc(void *w, int c) {
if (cursor1->line && (cursor1->ch < LINE_START(widget, cursor1->line))) {
cursor1->line--;
eve_textw_cursor_update(widget, cursor1);
- set_focus(widget, cursor1);
+ show_rect(widget, cursor1);
} else if (cursor1->ch > LINE_END(widget, cursor1->line)) {
while (cursor1->ch > LINE_END(widget, cursor1->line)) cursor1->line++;
eve_textw_cursor_update(widget, cursor1);
- set_focus(widget, cursor1);
+ show_rect(widget, cursor1);
} else {
cursor1->x += ch_w;
}