From 5d4e59271ab08816cd4fe4c3703edae7bda0d690 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 3 Feb 2016 16:04:23 -0800 Subject: [PATCH] Switch display sleep button to ImageButton. --- firmware/application/ui_navigation.cpp | 2 +- firmware/application/ui_navigation.hpp | 29 ++++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 3 deletions(-) diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index fc7248c3b..dfa252317 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -53,7 +53,7 @@ SystemStatusView::SystemStatusView() { } }; - button_sleep.on_select = [this](Button&) { + button_sleep.on_select = [this](ImageButton&) { DisplaySleepMessage message; EventDispatcher::message_map().send(&message); }; diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index 14beadc92..48c409902 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -37,6 +37,29 @@ namespace ui { +static constexpr uint8_t bitmap_sleep_data[] = { + 0x00, 0x00, + 0x00, 0x00, + 0x00, 0x04, + 0x00, 0x08, + 0x00, 0x18, + 0x00, 0x18, + 0x00, 0x38, + 0x00, 0x3c, + 0x00, 0x3c, + 0x00, 0x3e, + 0x84, 0x1f, + 0xf8, 0x1f, + 0xf0, 0x0f, + 0xc0, 0x03, + 0x00, 0x00, + 0x00, 0x00, +}; + +static constexpr Bitmap bitmap_sleep { + { 16, 16 }, bitmap_sleep_data +}; + class SystemStatusView : public View { public: std::function on_back; @@ -59,9 +82,11 @@ private: default_title, }; - Button button_sleep { + ImageButton button_sleep { { 25 * 8, 0, 2 * 8, 1 * 16 }, - "ZZ", + &bitmap_sleep, + Color::white(), + Color::black() }; SDCardStatusView sd_card_status_view {