#include "specter/MessageWindow.hpp" #include "specter/IViewManager.hpp" #include "specter/Menu.hpp" #include "specter/MultiLineTextView.hpp" #include "specter/RootView.hpp" #include "specter/ViewResources.hpp" #include #include namespace specter { MessageWindow::MessageWindow(ViewResources& res, View& parentView, Type type, std::string_view message, std::function func) : ModalWindow(res, parentView, RectangleConstraint(), type == Type::ErrorOk ? res.themeData().splashErrorBackground() : res.themeData().splashBackground()) , m_type(type) , m_func(std::move(func)) , m_okBind(*this, rootView().viewManager().translate()) , m_cancelBind(*this, rootView().viewManager().translate()) { m_text = std::make_unique(res, *this, res.m_mainFont, TextView::Alignment::Center); m_text->typesetGlyphs(message, res.themeData().uiText(), 380 * res.pixelFactor()); constraint() = RectangleConstraint(400 * res.pixelFactor(), 80 * res.pixelFactor() + m_text->nominalHeight()); m_ok.m_view = std::make_unique