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");
84 connect(toggleaction, SIGNAL(triggered(
bool)),
m_chkAssistant, SLOT(toggle()), Qt::UniqueConnection);
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"));
445 QWidget* distanceLabelWidget =
new QWidget(optionsWidget);
446 QVBoxLayout* distanceLabelLayout =
new QVBoxLayout(distanceLabelWidget);
447 distanceLabelLayout->setContentsMargins(0,0,0,0);
448 distanceLabelLayout->setSpacing(5);
453 QWidget* distanceSliderWidget =
new QWidget(optionsWidget);
454 QGridLayout* distanceSliderLayout =
new QGridLayout(distanceSliderWidget);
455 distanceSliderLayout->setContentsMargins(0,0,0,0);
456 distanceSliderLayout->setHorizontalSpacing(0);
457 distanceSliderLayout->setVerticalSpacing(5);
482 QWidget* delayWidget =
new QWidget(optionsWidget);
483 QHBoxLayout* delayLayout =
new QHBoxLayout(delayWidget);
484 delayLayout->setContentsMargins(0,0,0,0);
485 delayLayout->setSpacing(1);
486 QLabel* delayLabel =
new QLabel(i18n(
"Delay:"), optionsWidget);
487 delayLabel->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
488 delayLayout->addWidget(delayLabel);
491 delayWidget->setToolTip(i18n(
"Delay the brush stroke to make the line smoother"));
534 "Scalable distance takes zoom level "
535 "into account and makes the distance "
536 "be visually constant whatever zoom "
542 QFrame* line =
new QFrame(optionsWidget);
543 line->setObjectName(QString::fromUtf8(
"line"));
544 line->setFrameStyle(QFrame::HLine | QFrame::Sunken);
548 QWidget* assistantWidget =
new QWidget(optionsWidget);
549 QGridLayout* assistantLayout =
new QGridLayout(assistantWidget);
550 assistantLayout->setContentsMargins(10,0,0,0);
551 assistantLayout->setSpacing(5);
556 assistantWidget->setToolTip(i18n(
"You need to add Assistants before this tool will work."));
567 QLabel* magnetismLabel =
new QLabel(i18n(
"Magnetism:"), optionsWidget);
570 QLabel* snapSingleLabel =
new QLabel(i18n(
"Snap to Single Line"), optionsWidget);
573 m_chkOnlyOneAssistant->setToolTip(i18nc(
"@info:tooltip",
"Make it only snap to a single assistant line, prevents snapping mess while using the infinite assistants."));
578 QLabel* snapEraserLabel =
new QLabel(i18n(
"Snap Eraser"), optionsWidget);
581 m_chkSnapEraser->setToolTip(i18nc(
"@info:tooltip",
"Enable snapping when using erasers"));
590 magnetismLabel->setVisible(
false);
591 snapSingleLabel->setVisible(
false);
592 snapEraserLabel->setVisible(
false);
597 connect(
m_chkAssistant, SIGNAL(toggled(
bool)), magnetismLabel, SLOT(setVisible(
bool)));
598 connect(
m_chkAssistant, SIGNAL(toggled(
bool)), snapSingleLabel, SLOT(setVisible(
bool)));
599 connect(
m_chkAssistant, SIGNAL(toggled(
bool)), snapEraserLabel, SLOT(setVisible(
bool)));
605 return optionsWidget;
614 actions << actionRegistry->
makeQAction(
"set_no_brush_smoothing",
this);
615 actions << actionRegistry->
makeQAction(
"set_simple_brush_smoothing",
this);
616 actions << actionRegistry->
makeQAction(
"set_weighted_brush_smoothing",
this);
617 actions << actionRegistry->
makeQAction(
"set_stabilizer_brush_smoothing",
this);
618 actions << actionRegistry->
makeQAction(
"set_pixel_perfect_smoothing",
this);
619 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)
QAction * makeQAction(const QString &name, QObject *parent=0)
static KisActionRegistry * instance()
void connectSpinBoxes(SpinBoxType *spinOne, SpinBoxType *spinTwo, KoAspectButton *aspectButton)
void sliderValueChanged()
void aspectButtonToggled(bool value)
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)