From 1f2b28b2b875d736e64f43e2ef95767cc3ad7554 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 14 Jan 2016 09:30:23 -0800 Subject: [PATCH] Add AISAppView. --- firmware/application/ais_app.cpp | 11 +++++++++++ firmware/application/ais_app.hpp | 10 ++++++++++ firmware/application/ui_receiver.cpp | 2 +- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/firmware/application/ais_app.cpp b/firmware/application/ais_app.cpp index 58604311..b062621f 100644 --- a/firmware/application/ais_app.cpp +++ b/firmware/application/ais_app.cpp @@ -292,4 +292,15 @@ void AISRecentEntriesView::advance(const int32_t amount) { set_dirty(); } +AISAppView::AISAppView() { + add_children({ { + &recent_entries_view, + } }); +} + +void AISAppView::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() }); +} + } /* namespace ui */ diff --git a/firmware/application/ais_app.hpp b/firmware/application/ais_app.hpp index 43e56771..4f425171 100644 --- a/firmware/application/ais_app.hpp +++ b/firmware/application/ais_app.hpp @@ -134,6 +134,16 @@ private: void advance(const int32_t amount); }; +class AISAppView : public View { +public: + AISAppView(); + + void set_parent_rect(const Rect new_parent_rect) override; + +private: + AISRecentEntriesView recent_entries_view; +}; + } /* namespace ui */ #endif/*__AIS_APP_H__*/ diff --git a/firmware/application/ui_receiver.cpp b/firmware/application/ui_receiver.cpp index 2c17edfa..20dc46b9 100644 --- a/firmware/application/ui_receiver.cpp +++ b/firmware/application/ui_receiver.cpp @@ -517,7 +517,7 @@ void ReceiverView::on_modulation_changed(ReceiverModel::Mode mode) { break; case ReceiverModel::Mode::AIS: - widget_content = std::make_unique(); + widget_content = std::make_unique(); break; case ReceiverModel::Mode::SpectrumAnalysis: