summaryrefslogtreecommitdiff
path: root/src/ui/include/screen.hpp
diff options
context:
space:
mode:
authorjacqueline <me@jacqueline.id.au>2023-07-07 15:30:19 +1000
committerjacqueline <me@jacqueline.id.au>2023-07-07 15:30:19 +1000
commitb6e0e0dd4a177614797b6c6ac3b0c213d5a56f8a (patch)
tree1bf97a9455e27840c4c6d65bc9cc9832e8379dea /src/ui/include/screen.hpp
parent5af0ff2972023f35d8930ab3189cf04f6d9ff21b (diff)
parent39f7545cd5ef7a30bbd482f3579df7744c6b688d (diff)
downloadtangara-fw-b6e0e0dd4a177614797b6c6ac3b0c213d5a56f8a.tar.gz
Merge branch 'functional-playing'
Diffstat (limited to 'src/ui/include/screen.hpp')
-rw-r--r--src/ui/include/screen.hpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ui/include/screen.hpp b/src/ui/include/screen.hpp
index 7ff06fbd..13b92a09 100644
--- a/src/ui/include/screen.hpp
+++ b/src/ui/include/screen.hpp
@@ -15,14 +15,24 @@
namespace ui {
+/*
+ * Base class for ever discrete screen in the app. Provides a consistent
+ * interface that can be used for transitioning between screens, adding them to
+ * back stacks, etc.
+ */
class Screen {
public:
Screen() : root_(lv_obj_create(NULL)), group_(lv_group_create()) {}
+
virtual ~Screen() {
lv_obj_del(root_);
lv_group_del(group_);
}
+ /*
+ * Called periodically to allow the screen to update itself, e.g. to handle
+ * std::futures that are still loading in.
+ */
virtual auto Tick() -> void {}
auto root() -> lv_obj_t* { return root_; }