Very crude ModalMessageView.

Initially for displaying filesystem errors.
This commit is contained in:
Jared Boone 2016-05-12 21:58:54 -07:00
parent ebf0e765ce
commit 92d75fa46d
2 changed files with 37 additions and 0 deletions

View File

@ -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 */

View File

@ -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__*/