New Canvas presets in a More menu; every save writes QuickLook/Preview.jpg (13.7)

This commit is contained in:
ZacharyZhang-NY committed 2026-10-01 15:58:57 -04:00
1 parent 765e071c0c
commit 0616f9b006
12 files changed
+420 -7

No files matched your search

+15
View File
@@ -4,8 +4,20 @@
#include <QLineEdit>
#include <QMimeData>
#include <QPushButton>
#include <QToolButton>
#include <QWidget>
#include <functional>
#include <vector>
// New Canvas sizes in pixels, upright as held.
struct CanvasPreset {
QString title;
int width;
int height;
// Resolutions, Apple screens, then social formats; the menu divides them.
static const std::vector<std::vector<CanvasPreset>> groups;
static const std::vector<CanvasPreset> all;
};
// The welcome: a new canvas, a project or an image.
class NewCanvasSheet : public QWidget {
@@ -23,6 +35,8 @@ private:
void synchronize();
void validate();
void create();
// Checks the preset the fields match, else Custom.
void checkPreset();
EditorSession &m_session;
const std::function<void(int, int)> m_onCreate;
@@ -30,5 +44,6 @@ private:
QLineEdit *const m_height;
QLabel *const m_note;
QPushButton *const m_create;
QToolButton *const m_presets;
bool m_suggestedClipboardSize = false;
};