diff options
Diffstat (limited to 'source/widget.hpp')
-rw-r--r-- | source/widget.hpp | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/source/widget.hpp b/source/widget.hpp index afa9441..f94ccdb 100644 --- a/source/widget.hpp +++ b/source/widget.hpp @@ -3,6 +3,7 @@ class Adafruit_GFX; +#include <bluefruit.h> #include <cstring> class Widget { @@ -16,7 +17,8 @@ public: return height; } - virtual void render(Adafruit_GFX& display, unsigned int ypos) = 0; + virtual void render(Adafruit_GFX& display, int ypos) = 0; + virtual bool onPress(void) = 0; protected: inline void setHeight(unsigned int _height) { @@ -32,7 +34,10 @@ public: constexpr TimeWidget(void) : Widget(30), prevTicks(0) {} - void render(Adafruit_GFX& display, unsigned int ypos) final; + void render(Adafruit_GFX& display, int ypos) final; + bool onPress(void) final { + return false; + } }; class NotificationWidget : public Widget { @@ -49,6 +54,10 @@ public: setHeight(16 * (i / 12 + 1)); } - void render(Adafruit_GFX& display, unsigned int ypos) final; + void render(Adafruit_GFX& display, int ypos) final; + bool onPress(void) final { + return true; + } }; + #endif // WIDGET_HPP_ |