Changeset View
Changeset View
Standalone View
Standalone View
libs/widgets/KoStrokeConfigWidget.cpp
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
61 | #include <KoDocumentResourceManager.h> | 61 | #include <KoDocumentResourceManager.h> | ||
62 | #include <KoToolManager.h> | 62 | #include <KoToolManager.h> | ||
63 | #include <KoSelection.h> | 63 | #include <KoSelection.h> | ||
64 | #include <KoShapeController.h> | 64 | #include <KoShapeController.h> | ||
65 | #include <KoShapeManager.h> | 65 | #include <KoShapeManager.h> | ||
66 | #include <KoShapeStrokeCommand.h> | 66 | #include <KoShapeStrokeCommand.h> | ||
67 | #include <KoShapeStrokeModel.h> | 67 | #include <KoShapeStrokeModel.h> | ||
68 | 68 | | |||
69 | // Krita | ||||
70 | #include "kis_double_parse_unit_spin_box.h" | ||||
71 | | ||||
69 | class CapNJoinMenu : public QMenu | 72 | class CapNJoinMenu : public QMenu | ||
70 | { | 73 | { | ||
71 | public: | 74 | public: | ||
72 | CapNJoinMenu(QWidget *parent = 0); | 75 | CapNJoinMenu(QWidget *parent = 0); | ||
73 | virtual QSize sizeHint() const; | 76 | virtual QSize sizeHint() const; | ||
74 | 77 | | |||
75 | KoUnitDoubleSpinBox *miterLimit; | 78 | KisDoubleParseUnitSpinBox *miterLimit; | ||
76 | QButtonGroup *capGroup; | 79 | QButtonGroup *capGroup; | ||
77 | QButtonGroup *joinGroup; | 80 | QButtonGroup *joinGroup; | ||
78 | }; | 81 | }; | ||
79 | 82 | | |||
80 | CapNJoinMenu::CapNJoinMenu(QWidget *parent) | 83 | CapNJoinMenu::CapNJoinMenu(QWidget *parent) | ||
81 | : QMenu(parent) | 84 | : QMenu(parent) | ||
82 | { | 85 | { | ||
83 | QGridLayout *mainLayout = new QGridLayout(); | 86 | QGridLayout *mainLayout = new QGridLayout(); | ||
▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Line(s) | |||||
132 | button->setIcon(koIcon("stroke-join-bevel")); | 135 | button->setIcon(koIcon("stroke-join-bevel")); | ||
133 | button->setCheckable(true); | 136 | button->setCheckable(true); | ||
134 | button->setToolTip(i18n("Bevel join")); | 137 | button->setToolTip(i18n("Bevel join")); | ||
135 | joinGroup->addButton(button, Qt::BevelJoin); | 138 | joinGroup->addButton(button, Qt::BevelJoin); | ||
136 | mainLayout->addWidget(button, 3, 2, Qt::AlignLeft); | 139 | mainLayout->addWidget(button, 3, 2, Qt::AlignLeft); | ||
137 | 140 | | |||
138 | // Miter limit | 141 | // Miter limit | ||
139 | // set min/max/step and value in points, then set actual unit | 142 | // set min/max/step and value in points, then set actual unit | ||
140 | miterLimit = new KoUnitDoubleSpinBox(this); | 143 | miterLimit = new KisDoubleParseUnitSpinBox(this); | ||
141 | miterLimit->setMinMaxStep(0.0, 1000.0, 0.5); | 144 | miterLimit->setMinMaxStep(0.0, 1000.0, 0.5); | ||
142 | miterLimit->setDecimals(2); | 145 | miterLimit->setDecimals(2); | ||
143 | miterLimit->setUnit(KoUnit(KoUnit::Point)); | 146 | miterLimit->setUnit(KoUnit(KoUnit::Point)); | ||
144 | miterLimit->setToolTip(i18n("Miter limit")); | 147 | miterLimit->setToolTip(i18n("Miter limit")); | ||
145 | mainLayout->addWidget(miterLimit, 4, 0, 1, 3); | 148 | mainLayout->addWidget(miterLimit, 4, 0, 1, 3); | ||
146 | 149 | | |||
147 | mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); | 150 | mainLayout->setSizeConstraint(QLayout::SetMinAndMaxSize); | ||
148 | setLayout(mainLayout); | 151 | setLayout(mainLayout); | ||
Show All 10 Lines | |||||
159 | public: | 162 | public: | ||
160 | Private() | 163 | Private() | ||
161 | : canvas(0), | 164 | : canvas(0), | ||
162 | active(true) | 165 | active(true) | ||
163 | { | 166 | { | ||
164 | } | 167 | } | ||
165 | 168 | | |||
166 | KoLineStyleSelector *lineStyle; | 169 | KoLineStyleSelector *lineStyle; | ||
167 | KoUnitDoubleSpinBox *lineWidth; | 170 | KisDoubleParseUnitSpinBox *lineWidth; | ||
168 | KoMarkerSelector *startMarkerSelector; | 171 | KoMarkerSelector *startMarkerSelector; | ||
169 | KoMarkerSelector *endMarkerSelector; | 172 | KoMarkerSelector *endMarkerSelector; | ||
170 | 173 | | |||
171 | CapNJoinMenu *capNJoinMenu; | 174 | CapNJoinMenu *capNJoinMenu; | ||
172 | QToolButton *colorButton; | 175 | QToolButton *colorButton; | ||
173 | KoColorPopupAction *colorAction; | 176 | KoColorPopupAction *colorAction; | ||
174 | 177 | | |||
175 | QWidget *spacer; | 178 | QWidget *spacer; | ||
Show All 37 Lines | 188 | { | |||
213 | // Line width | 216 | // Line width | ||
214 | QLabel *l = new QLabel(this); | 217 | QLabel *l = new QLabel(this); | ||
215 | l->setText(i18n("Thickness:")); | 218 | l->setText(i18n("Thickness:")); | ||
216 | l->setAlignment(Qt::AlignRight | Qt::AlignVCenter); | 219 | l->setAlignment(Qt::AlignRight | Qt::AlignVCenter); | ||
217 | l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | 220 | l->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed); | ||
218 | secondLineLayout->addWidget(l); | 221 | secondLineLayout->addWidget(l); | ||
219 | 222 | | |||
220 | // set min/max/step and value in points, then set actual unit | 223 | // set min/max/step and value in points, then set actual unit | ||
221 | d->lineWidth = new KoUnitDoubleSpinBox(this); | 224 | d->lineWidth = new KisDoubleParseUnitSpinBox(this); | ||
222 | d->lineWidth->setMinMaxStep(0.0, 1000.0, 0.5); | 225 | d->lineWidth->setMinMaxStep(0.0, 1000.0, 0.5); | ||
223 | d->lineWidth->setDecimals(2); | 226 | d->lineWidth->setDecimals(2); | ||
224 | d->lineWidth->setUnit(KoUnit(KoUnit::Point)); | 227 | d->lineWidth->setUnit(KoUnit(KoUnit::Point)); | ||
225 | d->lineWidth->setToolTip(i18n("Set line width of actual selection")); | 228 | d->lineWidth->setToolTip(i18n("Set line width of actual selection")); | ||
226 | secondLineLayout->addWidget(d->lineWidth); | 229 | secondLineLayout->addWidget(d->lineWidth); | ||
227 | 230 | | |||
228 | QToolButton *capNJoinButton = new QToolButton(this); | 231 | QToolButton *capNJoinButton = new QToolButton(this); | ||
229 | capNJoinButton->setMinimumHeight(25); | 232 | capNJoinButton->setMinimumHeight(25); | ||
▲ Show 20 Lines • Show All 320 Lines • Show Last 20 Lines |