mirror of
https://codeberg.org/mclemens/ubitxv6.git
synced 2024-11-10 17:08:05 -05:00
Fix button drawing routine
This commit is contained in:
parent
efd3bfc5ad
commit
c727d876eb
11
button.cpp
11
button.cpp
@ -1,6 +1,9 @@
|
||||
#include "button.h"
|
||||
#include "nano_gui.h"
|
||||
|
||||
#include <avr/pgmspace.h>
|
||||
|
||||
#include "color_theme.h"
|
||||
#include "nano_gui.h"
|
||||
#include "ubitx.h"//b
|
||||
|
||||
void drawButton(Button* button)
|
||||
@ -26,18 +29,16 @@ void drawButton(Button* button)
|
||||
}
|
||||
|
||||
|
||||
const char* text = nullptr;
|
||||
if(nullptr != button->text){
|
||||
text = button->text;
|
||||
strncpy_P(b,button->text,sizeof(b));
|
||||
}
|
||||
else if(nullptr != button->text_override){
|
||||
button->text_override(b,sizeof(b));
|
||||
text = b;
|
||||
}
|
||||
else{
|
||||
//Something's messed up
|
||||
//Serial.println(F("No text for button!"));
|
||||
return;
|
||||
}
|
||||
displayText(text, button->x, button->y, button->w, button->h, tc, bgc, bdc);
|
||||
displayText(b, button->x, button->y, button->w, button->h, tc, bgc, bdc);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user