worked on SPI, fixed some bugs
adjusted LCD code added code for INA3221 worked on UI
This commit is contained in:
@@ -15,13 +15,20 @@ protected:
|
||||
UIRect rect;
|
||||
bool _visible = true;
|
||||
bool _needsRedraw = true;
|
||||
|
||||
|
||||
bool opaque = true;
|
||||
bool focus = false;
|
||||
|
||||
std::vector<UIElement*> children;
|
||||
|
||||
static constexpr const char* TAG = "UIElement";
|
||||
|
||||
public:
|
||||
|
||||
void setOpaque(bool opaque) {
|
||||
this->opaque = opaque;
|
||||
}
|
||||
|
||||
void setRect(const UIRect r) {
|
||||
this->rect = r;
|
||||
setNeedsRedraw();
|
||||
@@ -44,6 +51,11 @@ public:
|
||||
return this->_visible;
|
||||
}
|
||||
|
||||
void setFocus(bool focus) {
|
||||
this->focus = focus;
|
||||
setNeedsRedraw();
|
||||
}
|
||||
|
||||
void setNeedsRedraw() {
|
||||
this->_needsRedraw = true;
|
||||
}
|
||||
@@ -99,7 +111,7 @@ protected:
|
||||
|
||||
void _draw(UIPainter& p) {
|
||||
|
||||
// if hidde, ignore for me and children
|
||||
// if hiden, ignore for me and children
|
||||
if (!_visible) {return;}
|
||||
|
||||
// draw myself (if needed)
|
||||
|
||||
Reference in New Issue
Block a user