Krita Source Code Documentation
Loading...
Searching...
No Matches
dlg_canvassize.h
Go to the documentation of this file.
1/*
2 *
3 * SPDX-FileCopyrightText: 2009 Edward Apap <schumifer@hotmail.com>
4 * SPDX-FileCopyrightText: 2013 Juan Palacios <jpalaciosdev@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef DLG_CANVASSIZE
10#define DLG_CANVASSIZE
11
12#include <KoDialog.h>
13#include <QIcon>
14
15#include "ui_wdg_canvassize.h"
16
18
19class WdgCanvasSize : public QWidget, public Ui::WdgCanvasSize
20{
21 Q_OBJECT
22
23public:
24 WdgCanvasSize(QWidget *parent) : QWidget(parent) {
25 setupUi(this);
26 }
27};
28
29
30
32{
33
34 Q_OBJECT
35
36public:
38
39 static const QString PARAM_PREFIX;
40 static const QString PARAM_WIDTH_UNIT;
41 static const QString PARAM_HEIGHT_UNIT;
42 static const QString PARAM_XOFFSET_UNIT;
43 static const QString PARAM_YOFFSET_UNIT;
44
45 DlgCanvasSize(QWidget * parent, int width, int height, double resolution);
46 ~DlgCanvasSize() override;
47
48 qint32 width();
49 qint32 height();
50 qint32 xOffset();
51 qint32 yOffset();
53
54private Q_SLOTS:
55 void slotAspectChanged(bool keep);
57
58 void slotWidthChanged(double v);
59 void slotHeightChanged(double v);
60
61 void slotXOffsetChanged(double v);
62 void slotYOffsetChanged(double v);
63
66
67 void updatexOffsetIcon(bool v);
68 void updateyOffsetIcon(bool v);
69
70private:
71
72 void loadAnchorIcons();
73 void updateAnchorIcons(int id);
74 void updateButtons(int forceId);
75 void updateOffset(int id);
76 void expectedOffset(int id, double &xOffset, double &yOffset);
77
79 const double m_aspectRatio;
80 const double m_resolution;
84
85 QIcon m_anchorIcons[9];
86 QButtonGroup *m_group;
87
90
93};
94
95
96#endif // DLG_CANVASSIZE
qreal v
KisDocumentAwareSpinBoxUnitManager * _xOffsetUnitManager
void slotHeightChanged(double v)
static const QString PARAM_YOFFSET_UNIT
void updatexOffsetIcon(bool v)
void slotCanvasPreviewXOffsetChanged(int v)
const int m_originalWidth
static const QString PARAM_PREFIX
KisDocumentAwareSpinBoxUnitManager * _widthUnitManager
void updateyOffsetIcon(bool v)
QButtonGroup * m_group
static const QString PARAM_HEIGHT_UNIT
~DlgCanvasSize() override
WdgCanvasSize * m_page
void updateAnchorIcons(int id)
void slotYOffsetChanged(double v)
void expectedOffset(int id, double &xOffset, double &yOffset)
const int m_originalHeight
static const QString PARAM_XOFFSET_UNIT
void updateOffset(int id)
const double m_resolution
KisDocumentAwareSpinBoxUnitManager * _yOffsetUnitManager
const double m_aspectRatio
void slotCanvasPreviewYOffsetChanged(int v)
void slotAspectChanged(bool keep)
DlgCanvasSize(QWidget *parent, int width, int height, double resolution)
KisDocumentAwareSpinBoxUnitManager * _heightUnitManager
QIcon m_anchorIcons[9]
void slotWidthChanged(double v)
static const QString PARAM_WIDTH_UNIT
void updateButtons(int forceId)
void slotAnchorButtonClicked(int)
void slotXOffsetChanged(double v)
The KisDocumentAwareSpinBoxUnitManager class is a KisSpinBoxUnitManager that is able to connect to th...
A dialog base class with standard buttons and predefined layouts.
Definition KoDialog.h:116
WdgCanvasSize(QWidget *parent)