Switch display sleep button to ImageButton.

This commit is contained in:
Jared Boone 2016-02-03 16:04:23 -08:00
parent dd6d56cff8
commit 5d4e59271a
2 changed files with 28 additions and 3 deletions

View File

@ -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);
};

View File

@ -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<void(void)> 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 {