16#include <klocalizedstring.h>
40#define MAXIMUM_SMOOTHNESS_DISTANCE 1000.0
41#define MAXIMUM_MAGNETISM 1000
57 KisCursor::load(
"tool_freehand_cursor.xpm", 2, 2),
60 setObjectName(
"tool_brush");
83 QAction *toggleaction =
action(
"toggle_assistant");
90 QAction *toggleaction =
action(
"toggle_assistant");
404 optionsWidget->setObjectName(
toolId() +
"option widget");
407 QWidget *specialSpacer =
new QWidget(optionsWidget);
408 specialSpacer->setObjectName(
"SpecialSpacer");
409 specialSpacer->setFixedSize(0, 0);
410 optionsWidget->layout()->addWidget(specialSpacer);
415 << i18nc(
"@item:inlistbox Brush Smoothing",
"None")
416 << i18nc(
"@item:inlistbox Brush Smoothing",
"Basic")
417 << i18nc(
"@item:inlistbox Brush Smoothing",
"Weighted")
418 << i18nc(
"@item:inlistbox Brush Smoothing",
"Stabilizer")
419 << i18nc(
"@item:inlistbox Brush Smoothing",
"Pixel"));
449 QWidget* distanceLabelWidget =
new QWidget(optionsWidget);
450 QVBoxLayout* distanceLabelLayout =
new QVBoxLayout(distanceLabelWidget);
451 distanceLabelLayout->setContentsMargins(0,0,0,0);
452 distanceLabelLayout->setSpacing(5);
457 QWidget* distanceSliderWidget =
new QWidget(optionsWidget);
458 QGridLayout* distanceSliderLayout =
new QGridLayout(distanceSliderWidget);
459 distanceSliderLayout->setContentsMargins(0,0,0,0);
460 distanceSliderLayout->setHorizontalSpacing(0);
461 distanceSliderLayout->setVerticalSpacing(5);
478 QWidget* delayWidget =
new QWidget(optionsWidget);
479 QHBoxLayout* delayLayout =
new QHBoxLayout(delayWidget);
480 delayLayout->setContentsMargins(0,0,0,0);
481 delayLayout->setSpacing(1);
482 QLabel* delayLabel =
new QLabel(i18n(
"Delay:"), optionsWidget);
483 delayLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
484 delayLayout->addWidget(delayLabel);
487 delayWidget->setToolTip(i18n(
"Delay the brush stroke to make the line smoother"));
530 "Scalable distance takes zoom level "
531 "into account and makes the distance "
532 "be visually constant whatever zoom "
538 QFrame* line =
new QFrame(optionsWidget);
539 line->setObjectName(QString::fromUtf8(
"line"));
540 line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
544 QWidget* assistantWidget =
new QWidget(optionsWidget);
545 QGridLayout* assistantLayout =
new QGridLayout(assistantWidget);
546 assistantLayout->setContentsMargins(10,0,0,0);
547 assistantLayout->setSpacing(5);
552 assistantWidget->setToolTip(i18n(
"You need to add Assistants before this tool will work."));
563 QLabel* magnetismLabel =
new QLabel(i18n(
"Magnetism:"), optionsWidget);
566 QLabel* snapSingleLabel =
new QLabel(i18n(
"Snap to Single Line"), optionsWidget);
569 m_chkOnlyOneAssistant->setToolTip(i18nc(
"@info:tooltip",
"Make it only snap to a single assistant line, prevents snapping mess while using the infinite assistants."));
574 QLabel* snapEraserLabel =
new QLabel(i18n(
"Snap Eraser"), optionsWidget);
577 m_chkSnapEraser->setToolTip(i18nc(
"@info:tooltip",
"Enable snapping when using erasers"));
586 magnetismLabel->setVisible(
false);
587 snapSingleLabel->setVisible(
false);
588 snapEraserLabel->setVisible(
false);
601 return optionsWidget;
610 actions << actionRegistry->
makeQAction(
"set_no_brush_smoothing",
this);
611 actions << actionRegistry->
makeQAction(
"set_simple_brush_smoothing",
this);
612 actions << actionRegistry->
makeQAction(
"set_weighted_brush_smoothing",
this);
613 actions << actionRegistry->
makeQAction(
"set_stabilizer_brush_smoothing",
this);
614 actions << actionRegistry->
makeQAction(
"set_pixel_perfect_smoothing",
this);
615 actions << actionRegistry->
makeQAction(
"toggle_assistant",
this);
float value(const T *src, size_t ch)
QList< QString > QStringList
qreal distance(const QPointF &p1, const QPointF &p2)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
QAction * makeQAction(const QString &name, QObject *parent=0)
static KisActionRegistry * instance()
void connectSpinBoxes(SpinBoxType *spinOne, SpinBoxType *spinTwo, KoAspectButton *aspectButton)
int lineSmoothingType(bool defaultValue=false) const
CursorStyle newCursorStyle(bool defaultValue=false) const
static QCursor roundCursor()
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setValue(qreal newValue)
void setRange(qreal newMinimum, qreal newMaximum, int newNumberOfDecimals=0, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range.
void setExponentRatio(qreal newExponentRatio)
void setMapping(QObject *sender, int id)
This class is a spinbox in which you can click and drag to set the value. A slider like bar is displa...
void setValue(int newValue)
void setRange(int newMinimum, int newMaximum, bool computeNewFastSliderStep=true)
Set the minimum and the maximum values of the range, computing a new "fast slider step" based on the ...
static bool qFuzzyCompare(half p1, half p2)
KUndo2MagicString kundo2_i18n(const char *text)