#pragma once #include "Document/EditorSession.h" #include #include #include #include #include #include // The welcome: a new canvas, a project or an image. class NewCanvasSheet : public QWidget { Q_OBJECT public: NewCanvasSheet(EditorSession &session, std::function onCreate, std::function onOpen, QWidget *parent = nullptr); // A copied picture's size, read from its header alone. static std::optional clipboardDimensions(const QMimeData *clipboard); protected: void showEvent(QShowEvent *event) override; private: void synchronize(); void validate(); void create(); EditorSession &m_session; const std::function m_onCreate; QLineEdit *const m_width; QLineEdit *const m_height; QLabel *const m_note; QPushButton *const m_create; bool m_suggestedClipboardSize = false; };