worked on SPI, fixed some bugs
adjusted LCD code added code for INA3221 worked on UI
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
class UILabel : public UIElement {
|
||||
|
||||
std::string txt;
|
||||
|
||||
|
||||
Color cBackground = Color::fromRGB(255,255,255);
|
||||
Color cText = Color::fromRGB(0,0,0);
|
||||
|
||||
@@ -21,18 +21,21 @@ public:
|
||||
;
|
||||
}
|
||||
|
||||
/** set the text to draw */
|
||||
void setText(const std::string& txt) {
|
||||
this->txt = txt;
|
||||
setNeedsRedraw();
|
||||
}
|
||||
|
||||
|
||||
|
||||
void draw(UIPainter& p) {
|
||||
/** draw the label */
|
||||
void draw(UIPainter& p) override {
|
||||
|
||||
p.setFG(cBackground);
|
||||
p.fillRect(rect);
|
||||
|
||||
//const uint16_t txtW = fnt_f1.getWidth(txt);
|
||||
//const uint16_t txtH = fnt_f1.getHeight();
|
||||
if (opaque) {
|
||||
p.setFG(cBackground);
|
||||
p.fillRect(rect);
|
||||
}
|
||||
|
||||
p.setFG(cText);
|
||||
p.drawText(rect.x, rect.y, txt.c_str());
|
||||
|
||||
Reference in New Issue
Block a user