Changeset View
Changeset View
Standalone View
Standalone View
libs/basicflakes/tools/KoPencilTool.cpp
Show First 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
45 | #include <QCheckBox> | 45 | #include <QCheckBox> | ||
46 | #include <QVBoxLayout> | 46 | #include <QVBoxLayout> | ||
47 | #include <QPainter> | 47 | #include <QPainter> | ||
48 | #include <QLabel> | 48 | #include <QLabel> | ||
49 | 49 | | |||
50 | #include <math.h> | 50 | #include <math.h> | ||
51 | 51 | | |||
52 | #include "KoCreatePathTool_p.h" | 52 | #include "KoCreatePathTool_p.h" | ||
53 | #include "kis_double_parse_spin_box.h" | ||||
53 | 54 | | |||
54 | KoPencilTool::KoPencilTool(KoCanvasBase *canvas) | 55 | KoPencilTool::KoPencilTool(KoCanvasBase *canvas) | ||
55 | : KoToolBase(canvas) | 56 | : KoToolBase(canvas) | ||
56 | , m_mode(ModeCurve) | 57 | , m_mode(ModeCurve) | ||
57 | , m_optimizeRaw(false) | 58 | , m_optimizeRaw(false) | ||
58 | , m_optimizeCurve(false) | 59 | , m_optimizeCurve(false) | ||
59 | , m_combineAngle(15.0) | 60 | , m_combineAngle(15.0) | ||
60 | , m_fittingError(5.0) | 61 | , m_fittingError(5.0) | ||
▲ Show 20 Lines • Show All 244 Lines • ▼ Show 20 Line(s) | 287 | { | |||
305 | QVBoxLayout * rawLayout = new QVBoxLayout(rawBox); | 306 | QVBoxLayout * rawLayout = new QVBoxLayout(rawBox); | ||
306 | QCheckBox * optimizeRaw = new QCheckBox(i18n("Optimize"), rawBox); | 307 | QCheckBox * optimizeRaw = new QCheckBox(i18n("Optimize"), rawBox); | ||
307 | rawLayout->addWidget(optimizeRaw); | 308 | rawLayout->addWidget(optimizeRaw); | ||
308 | rawLayout->setContentsMargins(0, 0, 0, 0); | 309 | rawLayout->setContentsMargins(0, 0, 0, 0); | ||
309 | 310 | | |||
310 | QWidget * curveBox = new QWidget(stackedWidget); | 311 | QWidget * curveBox = new QWidget(stackedWidget); | ||
311 | QHBoxLayout * curveLayout = new QHBoxLayout(curveBox); | 312 | QHBoxLayout * curveLayout = new QHBoxLayout(curveBox); | ||
312 | QCheckBox * optimizeCurve = new QCheckBox(i18n("Optimize"), curveBox); | 313 | QCheckBox * optimizeCurve = new QCheckBox(i18n("Optimize"), curveBox); | ||
313 | QDoubleSpinBox * fittingError = new QDoubleSpinBox(curveBox); | 314 | QDoubleSpinBox * fittingError = new KisDoubleParseSpinBox(curveBox); | ||
314 | fittingError->setValue(0.50); | 315 | fittingError->setValue(0.50); | ||
315 | fittingError->setMaximum(400.0); | 316 | fittingError->setMaximum(400.0); | ||
316 | fittingError->setMinimum(0.0); | 317 | fittingError->setMinimum(0.0); | ||
317 | fittingError->setSingleStep(m_fittingError); | 318 | fittingError->setSingleStep(m_fittingError); | ||
318 | fittingError->setToolTip(i18n("Exactness:")); | 319 | fittingError->setToolTip(i18n("Exactness:")); | ||
319 | curveLayout->addWidget(optimizeCurve); | 320 | curveLayout->addWidget(optimizeCurve); | ||
320 | curveLayout->addWidget(fittingError); | 321 | curveLayout->addWidget(fittingError); | ||
321 | curveLayout->setContentsMargins(0, 0, 0, 0); | 322 | curveLayout->setContentsMargins(0, 0, 0, 0); | ||
322 | 323 | | |||
323 | QWidget *straightBox = new QWidget(stackedWidget); | 324 | QWidget *straightBox = new QWidget(stackedWidget); | ||
324 | QVBoxLayout *straightLayout = new QVBoxLayout(straightBox); | 325 | QVBoxLayout *straightLayout = new QVBoxLayout(straightBox); | ||
325 | QDoubleSpinBox *combineAngle = new QDoubleSpinBox(straightBox); | 326 | QDoubleSpinBox *combineAngle = new KisDoubleParseSpinBox(straightBox); | ||
326 | combineAngle->setValue(0.50); | 327 | combineAngle->setValue(0.50); | ||
327 | combineAngle->setMaximum(360.0); | 328 | combineAngle->setMaximum(360.0); | ||
328 | combineAngle->setMinimum(0.0); | 329 | combineAngle->setMinimum(0.0); | ||
329 | combineAngle->setSingleStep(m_combineAngle); | 330 | combineAngle->setSingleStep(m_combineAngle); | ||
330 | combineAngle->setSuffix(" deg"); | 331 | combineAngle->setSuffix(" deg"); | ||
331 | // QT5TODO | 332 | // QT5TODO | ||
332 | //combineAngle->setLabel(i18n("Combine angle:"), Qt::AlignLeft | Qt::AlignVCenter); | 333 | //combineAngle->setLabel(i18n("Combine angle:"), Qt::AlignLeft | Qt::AlignVCenter); | ||
333 | straightLayout->addWidget(combineAngle); | 334 | straightLayout->addWidget(combineAngle); | ||
▲ Show 20 Lines • Show All 225 Lines • Show Last 20 Lines |