Center modal view message.

This commit is contained in:
Jared Boone 2016-05-17 10:29:49 -07:00
parent ac49726707
commit 65d2f263f2
2 changed files with 7 additions and 4 deletions

View File

@ -309,6 +309,12 @@ ModalMessageView::ModalMessageView(
} });
text_message.set(message);
const int text_message_width = message.size() * 8;
text_message.set_parent_rect({
(240 - text_message_width) / 2, 7 * 16,
text_message_width, 16
});
}
void ModalMessageView::focus() {

View File

@ -223,10 +223,7 @@ public:
private:
const std::string title_;
Text text_message {
{ 0 * 8, 7 * 16, 30 * 8, 16 },
""
};
Text text_message { };
Button button_done {
{ 10 * 8, 13 * 16, 10 * 8, 24 },