attach windo focusHandler to LVGL events

This commit is contained in:
gagarinlg
2022-06-11 15:13:11 +02:00
committed by Raphael Coeffic
parent 85e9f1d7ca
commit c1e143c4fd
2 changed files with 9 additions and 0 deletions
+6
View File
@@ -139,6 +139,12 @@ extern "C" void window_event_cb(lv_event_t * e)
else if (code == LV_EVENT_CANCEL) {
TRACE("CANCEL[%p]", window);
window->onCancel();
} else if (code == LV_EVENT_FOCUSED) {
if(window->focusHandler)
window->focusHandler(true);
} else if (code == LV_EVENT_DEFOCUSED) {
if(window->focusHandler)
window->focusHandler(false);
}
}
+3
View File
@@ -65,10 +65,13 @@ constexpr WindowFlags WINDOW_FLAGS_LAST = PUSH_FRONT;
// };
typedef lv_obj_t *(*LvglCreate)(lv_obj_t *);
extern "C" void window_event_cb(lv_event_t * e);
class Window
{
friend class GridLayout;
friend void window_event_cb(lv_event_t * e);
public:
Window(Window *parent, const rect_t &rect, WindowFlags windowFlags = 0,