improve text node xml

This commit is contained in:
2019-11-29 02:17:54 +01:00
parent c6173987af
commit 26257e5a37
5 changed files with 59 additions and 28 deletions

View File

@@ -1100,7 +1100,7 @@ void App::init_menu_about()
text->set_text(label);
}
item->on_click = [this, popup](Node*) {
dialog_changelog();
dialog_whatsnew();
popup->mouse_release();
popup->destroy();
};
@@ -1334,31 +1334,7 @@ void App::initLayout()
}
}
auto whatsnew = std::make_shared<NodeRemotePage>();
whatsnew->m_manager = &layout;
whatsnew->init();
whatsnew->load_url("http://localhost:8080/app-content/whatsnew.xml", [this, whatsnew] (bool success) {
if (success)
{
int last_id = Settings::value_or<Serializer::Integer>("whatsnew-id", 0);
if (whatsnew->m_page_id <= g_version_build && whatsnew->m_page_id > last_id)
{
whatsnew->set_title(fmt::format("What's new in version {}", g_version_number));
layout[main_id]->add_child(whatsnew);
}
whatsnew->add_button("Reload", 120, [this, whatsnew](Node*) {
whatsnew->reload();
});
whatsnew->add_button("Read Later", 120, [this, whatsnew](Node*) {
whatsnew->destroy();
});
whatsnew->add_button("Close", 100, [this, whatsnew](Node*) {
Settings::set<Serializer::Integer>("whatsnew-id", whatsnew->m_page_id);
Settings::save();
whatsnew->destroy();
});
}
});
dialog_whatsnew();
brush_update(true, true);