From 07b8c6c6615ba82c27456d0deea6513c25af00d1 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 27 Jan 2016 10:18:44 -0800 Subject: [PATCH] Fix initial focus on ERT, TPMS apps. --- firmware/application/ert_app.cpp | 4 ++++ firmware/application/ert_app.hpp | 2 ++ firmware/application/tpms_app.cpp | 4 ++++ firmware/application/tpms_app.hpp | 2 ++ 4 files changed, 12 insertions(+) diff --git a/firmware/application/ert_app.cpp b/firmware/application/ert_app.cpp index 0fb8b709..9ca5800d 100644 --- a/firmware/application/ert_app.cpp +++ b/firmware/application/ert_app.cpp @@ -149,6 +149,10 @@ ERTAppView::~ERTAppView() { EventDispatcher::message_map().unregister_handler(Message::ID::ERTPacket); } +void ERTAppView::focus() { + recent_entries_view.focus(); +} + void ERTAppView::set_parent_rect(const Rect new_parent_rect) { View::set_parent_rect(new_parent_rect); recent_entries_view.set_parent_rect({ 0, 0, new_parent_rect.width(), new_parent_rect.height() }); diff --git a/firmware/application/ert_app.hpp b/firmware/application/ert_app.hpp index 996dad67..065f7f9b 100644 --- a/firmware/application/ert_app.hpp +++ b/firmware/application/ert_app.hpp @@ -83,6 +83,8 @@ public: // TODO: Add flag to View that specifies view does not need to be cleared before painting. void paint(Painter&) override { }; + void focus() override; + std::string title() const override { return "ERT"; }; private: diff --git a/firmware/application/tpms_app.cpp b/firmware/application/tpms_app.cpp index a7e4e5ec..2cc05c08 100644 --- a/firmware/application/tpms_app.cpp +++ b/firmware/application/tpms_app.cpp @@ -257,6 +257,10 @@ TPMSAppView::~TPMSAppView() { EventDispatcher::message_map().unregister_handler(Message::ID::TPMSPacket); } +void TPMSAppView::focus() { + recent_entries_view.focus(); +} + void TPMSAppView::set_parent_rect(const Rect new_parent_rect) { View::set_parent_rect(new_parent_rect); recent_entries_view.set_parent_rect({ 0, 0, new_parent_rect.width(), new_parent_rect.height() }); diff --git a/firmware/application/tpms_app.hpp b/firmware/application/tpms_app.hpp index ac3486cd..0ecf4884 100644 --- a/firmware/application/tpms_app.hpp +++ b/firmware/application/tpms_app.hpp @@ -207,6 +207,8 @@ public: // TODO: Add flag to View that specifies view does not need to be cleared before painting. void paint(Painter&) override { }; + void focus() override; + std::string title() const override { return "TPMS"; }; private: