diff options
| author | JF <jf@codingfield.com> | 2020-02-23 13:44:39 +0100 |
|---|---|---|
| committer | JF <jf@codingfield.com> | 2020-02-23 13:44:39 +0100 |
| commit | 02772b996fb26146cf38fc6deccff7f43a49dfd6 (patch) | |
| tree | f2ff90c577f68ccb44b6470621bf87e68a49aed8 /src/DisplayApp/Screens/Screen.h | |
| parent | 2bdff7ed2b490cb8ce5599341e12d707c0ba7fd0 (diff) | |
Do not compile GFX and older fonts anymore.
Refactor SystemTask in its own class.
Refactor Screen to be able to close current screen and open a new one.
Re-enable sleep/wake up and propagate button event to Screens.
Diffstat (limited to 'src/DisplayApp/Screens/Screen.h')
| -rw-r--r-- | src/DisplayApp/Screens/Screen.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/DisplayApp/Screens/Screen.h b/src/DisplayApp/Screens/Screen.h index 57b8ea2a..625daada 100644 --- a/src/DisplayApp/Screens/Screen.h +++ b/src/DisplayApp/Screens/Screen.h @@ -9,16 +9,18 @@ namespace Pinetime { class Screen { public: enum class NextScreen {None, Clock, Menu, App}; - Screen(DisplayApp* app, Components::Gfx& gfx) : app{app}, gfx{gfx} {} + + Screen(DisplayApp* app) : app{app} {} virtual ~Screen() = default; - virtual void Refresh(bool fullRefresh) = 0; - NextScreen GetNextScreen() {return nextScreen;} - virtual void OnButtonPushed() {}; + + // Return false if the app can be closed, true if it must continue to run + virtual bool Refresh(bool fullRefresh) = 0; + + // Return false if the button hasn't been handled by the app, true if it has been handled + virtual bool OnButtonPushed() { return false; } protected: DisplayApp* app; - Components::Gfx& gfx; - NextScreen nextScreen = NextScreen::None; }; } } |
