summaryrefslogtreecommitdiff
path: root/src/ui/include/screen.hpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2023-07-08 12:58:07 +1000
committerailurux <ailuruxx@gmail.com>2023-07-08 12:58:07 +1000
commit3de310f6e4c170c4c4bfb789cb07ca10e5ab17b8 (patch)
tree0d13d6efa758b8c029a35c73405529dcadde3788 /src/ui/include/screen.hpp
parentdaa3013836d619d920db3a9dc1f9cc988047a4b4 (diff)
parent8f8bc1f088b389a683735d626cbce9adb1f6dc17 (diff)
downloadtangara-fw-3de310f6e4c170c4c4bfb789cb07ca10e5ab17b8.tar.gz
Merge branch 'main' of git.sr.ht:~jacqueline/tangara-fw
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_; }