From 40d7f3a1346ba97905b33fa4363a0193c79a22ab Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Thu, 18 Feb 2016 21:35:46 -0800 Subject: [PATCH] Add screen capture button. --- firmware/application/ui_navigation.cpp | 8 +++++++ firmware/application/ui_navigation.hpp | 32 ++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 7a2d44510..c298da188 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -42,6 +42,7 @@ SystemStatusView::SystemStatusView() { add_children({ { &button_back, &title, + &button_camera, &button_sleep, &sd_card_status_view, } }); @@ -52,6 +53,10 @@ SystemStatusView::SystemStatusView() { } }; + button_camera.on_select = [this](ImageButton&) { + this->on_camera(); + }; + button_sleep.on_select = [this](ImageButton&) { DisplaySleepMessage message; EventDispatcher::message_map().send(&message); @@ -71,6 +76,9 @@ void SystemStatusView::set_title(const std::string new_value) { } } +void SystemStatusView::on_camera() { +} + /* Navigation ************************************************************/ bool NavigationView::is_top() const { diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 75b0aa2c7..004ddc0d4 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -60,6 +60,29 @@ static constexpr Bitmap bitmap_sleep { { 16, 16 }, bitmap_sleep_data }; +static constexpr uint8_t bitmap_camera_data[] = { + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, + 0xcc, 0x03, + 0xe8, 0x07, + 0xfc, 0x3f, + 0x3c, 0x3c, + 0x9c, 0x39, + 0xdc, 0x3b, + 0xdc, 0x3b, + 0x9c, 0x39, + 0x3c, 0x3c, + 0xfc, 0x3f, + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x00, +}; + +static constexpr Bitmap bitmap_camera { + { 16, 16 }, bitmap_camera_data +}; + class SystemStatusView : public View { public: std::function on_back; @@ -84,6 +107,13 @@ private: default_title, }; + ImageButton button_camera { + { 22 * 8, 0, 2 * 8, 1 * 16 }, + &bitmap_camera, + Color::white(), + Color::black() + }; + ImageButton button_sleep { { 25 * 8, 0, 2 * 8, 1 * 16 }, &bitmap_sleep, @@ -94,6 +124,8 @@ private: SDCardStatusView sd_card_status_view { { 28 * 8, 0 * 16, 2 * 8, 1 * 16 } }; + + void on_camera(); }; class NavigationView : public View {