mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-10-06 11:23:41 -04:00
Add color distinction to button drawing
This commit is contained in:
parent
2722b4367a
commit
efd3bfc5ad
18
button.cpp
18
button.cpp
@ -8,6 +8,24 @@ void drawButton(Button* button)
|
|||||||
uint16_t tc = COLOR_INACTIVE_TEXT;
|
uint16_t tc = COLOR_INACTIVE_TEXT;
|
||||||
uint16_t bgc = COLOR_INACTIVE_BACKGROUND;
|
uint16_t bgc = COLOR_INACTIVE_BACKGROUND;
|
||||||
const uint16_t bdc = COLOR_INACTIVE_BORDER;
|
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;
|
const char* text = nullptr;
|
||||||
if(nullptr != button->text){
|
if(nullptr != button->text){
|
||||||
text = button->text;
|
text = button->text;
|
||||||
|
Loading…
Reference in New Issue
Block a user