diff --git a/firmware/application/ui_navigation.cpp b/firmware/application/ui_navigation.cpp index 14f4cc6f..943d522a 100644 --- a/firmware/application/ui_navigation.cpp +++ b/firmware/application/ui_navigation.cpp @@ -273,4 +273,23 @@ void NotImplementedView::focus() { button_done.focus(); } +/* ModalMessageView ******************************************************/ + +ModalMessageView::ModalMessageView(NavigationView& nav, std::string message) { + button_done.on_select = [&nav](Button&){ + nav.pop(); + }; + + add_children({ { + &text_message, + &button_done, + } }); + + text_message.set(message); +} + +void ModalMessageView::focus() { + button_done.focus(); +} + } /* namespace ui */ diff --git a/firmware/application/ui_navigation.hpp b/firmware/application/ui_navigation.hpp index be5fb3c4..a932c907 100644 --- a/firmware/application/ui_navigation.hpp +++ b/firmware/application/ui_navigation.hpp @@ -205,6 +205,24 @@ private: }; }; +class ModalMessageView : public View { +public: + ModalMessageView(NavigationView& nav, std::string message); + + void focus() override; + +private: + Text text_message { + { 0 * 8, 7 * 16, 30 * 8, 16 }, + "" + }; + + Button button_done { + { 10 * 8, 13 * 16, 10 * 8, 24 }, + "OK", + }; +}; + } /* namespace ui */ #endif/*__UI_NAVIGATION_H__*/