mirror of
https://github.com/eried/portapack-mayhem.git
synced 2024-10-01 01:26:06 -04:00
Very crude ModalMessageView.
Initially for displaying filesystem errors.
This commit is contained in:
parent
ebf0e765ce
commit
92d75fa46d
@ -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 */
|
||||
|
@ -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__*/
|
||||
|
Loading…
Reference in New Issue
Block a user