From efd3bfc5ad05f91c07099f2401656125b6b80578 Mon Sep 17 00:00:00 2001 From: Reed Nightingale Date: Mon, 10 Feb 2020 01:34:02 -0800 Subject: [PATCH] Add color distinction to button drawing --- button.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/button.cpp b/button.cpp index 50adcb4..3af0bac 100644 --- a/button.cpp +++ b/button.cpp @@ -8,6 +8,24 @@ void drawButton(Button* button) uint16_t tc = COLOR_INACTIVE_TEXT; uint16_t bgc = COLOR_INACTIVE_BACKGROUND; const uint16_t bdc = COLOR_INACTIVE_BORDER; + switch(button->status()) + { + case ButtonStatus_e::Stateless://Fallthrough intended + case ButtonStatus_e::Inactive://Fallthrough intended + default: + { + //Colors are initialized for this, so we're done + break; + } + case ButtonStatus_e::Active: + { + tc = COLOR_ACTIVE_TEXT; + bgc = COLOR_ACTIVE_BACKGROUND; + break; + } + } + + const char* text = nullptr; if(nullptr != button->text){ text = button->text;