Modal dialog for partner file action, fix lifetime

This commit is contained in:
Kyle Reed 2023-05-02 09:38:08 -07:00
parent 2cba96ff36
commit 11f4edc892
10 changed files with 138 additions and 139 deletions

View file

@ -76,6 +76,15 @@ namespace ui
{
return reinterpret_cast<T *>(push_view(std::unique_ptr<View>(new T(*this, std::forward<Args>(args)...))));
}
// Pushes a new view under the current on the stack so the current view returns into this new one.
template <class T, class... Args>
void push_under_current(Args &&...args)
{
auto new_view = std::unique_ptr<View>(new T(*this, std::forward<Args>(args)...));
view_stack.insert(view_stack.end() - 1, std::move(new_view));
}
template <class T, class... Args>
T *replace(Args &&...args)
{