From 3f913efda03fd840cd526ef72e6f397c7da61bd7 Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Tue, 9 Aug 2022 22:23:08 +0200 Subject: code layout --- fw/fe310/eos/eve/widget/pagew.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'fw/fe310/eos/eve/widget/pagew.c') diff --git a/fw/fe310/eos/eve/widget/pagew.c b/fw/fe310/eos/eve/widget/pagew.c index bd7819f..c926892 100644 --- a/fw/fe310/eos/eve/widget/pagew.c +++ b/fw/fe310/eos/eve/widget/pagew.c @@ -8,17 +8,7 @@ #include "screen/window.h" #include "screen/page.h" -#include "label.h" #include "widget.h" -#include "pagew.h" - -int eve_pagew_create(EVEPageWidget *widget, EVERect *g, EVEPage *page, EVEPageSpec *spec) { - EVEFont *font = spec->font ? spec->font : eve_window_font(page->v.window); - - eve_pagew_init(widget, g, page, font, spec->title, spec->constructor); - - return EVE_OK; -} void eve_pagew_init(EVEPageWidget *widget, EVERect *g, EVEPage *page, EVEFont *font, char *title, eve_view_constructor_t constructor) { EVEWidget *_widget = &widget->w; @@ -31,6 +21,16 @@ void eve_pagew_init(EVEPageWidget *widget, EVERect *g, EVEPage *page, EVEFont *f if (_widget->g.h == 0) _widget->g.h = eve_font_h(widget->font); } +int eve_pagew_create(EVEWidget *_widget, EVEWidgetSpec *spec, EVEPage *page) { + EVEPageWidget *widget = (EVEPageWidget *)_widget; + EVEPageSpec *tspec = &spec->tspec.page; + EVEFont *font = tspec->font ? tspec->font : eve_window_font(page->v.window); + + eve_pagew_init(widget, &spec->g, page, font, tspec->title, tspec->constructor); + + return EVE_OK; +} + uint8_t eve_pagew_draw(EVEWidget *_widget, uint8_t tag0) { EVEPageWidget *widget = (EVEPageWidget *)_widget; @@ -51,6 +51,7 @@ int eve_pagew_touch(EVEWidget *_widget, EVETouch *touch, uint16_t evt) { EVEPageWidget *widget = (EVEPageWidget *)_widget; if (evt & EVE_TOUCH_ETYPE_TAG_UP) { + eve_widget_set_focus(_widget, NULL); eve_page_open(parent, widget->constructor); return 1; } -- cgit v1.2.3