Changeset View
Changeset View
Standalone View
Standalone View
ui/annotationwidgets.h
Show All 13 Lines | |||||
14 | 14 | | |||
15 | #include "core/annotations.h" | 15 | #include "core/annotations.h" | ||
16 | 16 | | |||
17 | class QCheckBox; | 17 | class QCheckBox; | ||
18 | class QComboBox; | 18 | class QComboBox; | ||
19 | class QDoubleSpinBox; | 19 | class QDoubleSpinBox; | ||
20 | class QFormLayout; | 20 | class QFormLayout; | ||
21 | class QLabel; | 21 | class QLabel; | ||
22 | class QPushButton; | ||||
22 | class QWidget; | 23 | class QWidget; | ||
23 | class KColorButton; | 24 | class KColorButton; | ||
24 | class QSpinBox; | 25 | class QSpinBox; | ||
25 | class KFontRequester; | 26 | class KFontRequester; | ||
26 | class AnnotationWidget; | 27 | class AnnotationWidget; | ||
27 | 28 | | |||
28 | class PixmapPreviewSelector | 29 | class PixmapPreviewSelector | ||
29 | : public QWidget | 30 | : public QWidget | ||
30 | { | 31 | { | ||
31 | Q_OBJECT | 32 | Q_OBJECT | ||
32 | 33 | | |||
33 | public: | 34 | public: | ||
34 | explicit PixmapPreviewSelector( QWidget * parent = nullptr ); | 35 | enum PreviewPosition{ Side, Below }; | ||
36 | | ||||
37 | explicit PixmapPreviewSelector( QWidget * parent = nullptr, PreviewPosition position = Side ); | ||||
ngraham: Instead of adding a new bool argument, how about an enum instead for clarity so the code is… | |||||
35 | virtual ~PixmapPreviewSelector(); | 38 | virtual ~PixmapPreviewSelector(); | ||
36 | 39 | | |||
37 | void setIcon( const QString& icon ); | 40 | void setIcon( const QString& icon ); | ||
38 | QString icon() const; | 41 | QString icon() const; | ||
39 | 42 | | |||
40 | void addItem( const QString& item, const QString& id ); | 43 | void addItem( const QString& item, const QString& id ); | ||
41 | 44 | | |||
42 | void setPreviewSize( int size ); | 45 | void setPreviewSize( int size ); | ||
43 | int previewSize() const; | 46 | int previewSize() const; | ||
44 | 47 | | |||
45 | void setEditable( bool editable ); | 48 | void setEditable( bool editable ); | ||
46 | 49 | | |||
47 | Q_SIGNALS: | 50 | Q_SIGNALS: | ||
48 | void iconChanged( const QString& ); | 51 | void iconChanged( const QString& ); | ||
49 | 52 | | |||
50 | private Q_SLOTS: | 53 | private Q_SLOTS: | ||
51 | void iconComboChanged( const QString& icon ); | 54 | void iconComboChanged( const QString& icon ); | ||
55 | void selectCustomStamp(); | ||||
52 | 56 | | |||
53 | private: | 57 | private: | ||
54 | QString m_icon; | 58 | QString m_icon; | ||
59 | QPushButton * m_stampPushButton; | ||||
55 | QLabel * m_iconLabel; | 60 | QLabel * m_iconLabel; | ||
56 | QComboBox * m_comboItems; | 61 | QComboBox * m_comboItems; | ||
57 | int m_previewSize; | 62 | int m_previewSize; | ||
63 | PreviewPosition m_previewPosition; | ||||
58 | }; | 64 | }; | ||
59 | 65 | | |||
60 | 66 | | |||
61 | /** | 67 | /** | ||
62 | * A factory to create AnnotationWidget's. | 68 | * A factory to create AnnotationWidget's. | ||
63 | */ | 69 | */ | ||
64 | class AnnotationWidgetFactory | 70 | class AnnotationWidgetFactory | ||
65 | { | 71 | { | ||
▲ Show 20 Lines • Show All 218 Lines • Show Last 20 Lines |
Instead of adding a new bool argument, how about an enum instead for clarity so the code is easy to read?