Changeset View
Changeset View
Standalone View
Standalone View
plugins/paintops/libpaintop/kis_brush_chooser.cpp
Context not available. | |||||
36 | #include <kconfig.h> | 36 | #include <kconfig.h> | ||
---|---|---|---|---|---|
37 | #include <ksharedconfig.h> | 37 | #include <ksharedconfig.h> | ||
38 | #include <kconfiggroup.h> | 38 | #include <kconfiggroup.h> | ||
39 | #include <KisKineticScroller.h> | ||||
39 | 40 | | |||
41 | #include <KoResourceItemView.h> | ||||
40 | #include <KoResourceItemChooser.h> | 42 | #include <KoResourceItemChooser.h> | ||
41 | 43 | | |||
42 | #include <kis_icon.h> | 44 | #include <kis_icon.h> | ||
Context not available. | |||||
118 | 120 | | |||
119 | QObject::connect(brushSizeSpinBox, SIGNAL(valueChanged(qreal)), this, SLOT(slotSetItemSize(qreal))); | 121 | QObject::connect(brushSizeSpinBox, SIGNAL(valueChanged(qreal)), this, SLOT(slotSetItemSize(qreal))); | ||
120 | 122 | | |||
121 | | ||||
122 | brushRotationSpinBox->setRange(0, 360, 0); | 123 | brushRotationSpinBox->setRange(0, 360, 0); | ||
123 | brushRotationSpinBox->setValue(0); | 124 | brushRotationSpinBox->setValue(0); | ||
124 | brushRotationSpinBox->setSuffix(QChar(Qt::Key_degree)); | 125 | brushRotationSpinBox->setSuffix(QChar(Qt::Key_degree)); | ||
Context not available. | |||||
127 | brushSpacingSelectionWidget->setSpacing(true, 1.0); | 128 | brushSpacingSelectionWidget->setSpacing(true, 1.0); | ||
128 | connect(brushSpacingSelectionWidget, SIGNAL(sigSpacingChanged()), SLOT(slotSpacingChanged())); | 129 | connect(brushSpacingSelectionWidget, SIGNAL(sigSpacingChanged()), SLOT(slotSpacingChanged())); | ||
129 | 130 | | |||
130 | | ||||
131 | QObject::connect(useColorAsMaskCheckbox, SIGNAL(toggled(bool)), this, SLOT(slotSetItemUseColorAsMask(bool))); | 131 | QObject::connect(useColorAsMaskCheckbox, SIGNAL(toggled(bool)), this, SLOT(slotSetItemUseColorAsMask(bool))); | ||
132 | 132 | | |||
133 | | ||||
134 | KisBrushResourceServer* rServer = KisBrushServer::instance()->brushServer(); | 133 | KisBrushResourceServer* rServer = KisBrushServer::instance()->brushServer(); | ||
135 | QSharedPointer<KisBrushResourceServerAdapter> adapter(new KisBrushResourceServerAdapter(rServer)); | 134 | QSharedPointer<KisBrushResourceServerAdapter> adapter(new KisBrushResourceServerAdapter(rServer)); | ||
136 | 135 | | |||
Context not available. | |||||
147 | m_itemChooser->setMinimumHeight(150); | 146 | m_itemChooser->setMinimumHeight(150); | ||
148 | m_itemChooser->showButtons(false); // turn the import and delete buttons since we want control over them | 147 | m_itemChooser->showButtons(false); // turn the import and delete buttons since we want control over them | ||
149 | 148 | | |||
150 | KisConfig cfg(true); | | |||
151 | m_itemChooser->configureKineticScrolling(cfg.kineticScrollingGesture(), | | |||
152 | cfg.kineticScrollingSensitivity(), | | |||
153 | cfg.kineticScrollingScrollbar()); | | |||
154 | | ||||
155 | 149 | | |||
156 | addPresetButton->setIcon(KisIconUtils::loadIcon("list-add")); | 150 | addPresetButton->setIcon(KisIconUtils::loadIcon("list-add")); | ||
157 | deleteBrushTipButton->setIcon(KisIconUtils::loadIcon("trash-empty")); | 151 | deleteBrushTipButton->setIcon(KisIconUtils::loadIcon("trash-empty")); | ||
Context not available. | |||||
173 | clipboardButton->setIcon(KisIconUtils::loadIcon("list-add")); | 167 | clipboardButton->setIcon(KisIconUtils::loadIcon("list-add")); | ||
174 | clipboardButton->setToolTip(i18n("Creates a brush tip from the image in the clipboard.")); | 168 | clipboardButton->setToolTip(i18n("Creates a brush tip from the image in the clipboard.")); | ||
175 | 169 | | |||
176 | | ||||
177 | connect(stampButton, SIGNAL(clicked()), this, SLOT(slotOpenStampBrush())); | 170 | connect(stampButton, SIGNAL(clicked()), this, SLOT(slotOpenStampBrush())); | ||
178 | connect(clipboardButton, SIGNAL(clicked()), SLOT(slotOpenClipboardBrush())); | 171 | connect(clipboardButton, SIGNAL(clicked()), SLOT(slotOpenClipboardBrush())); | ||
179 | 172 | | |||
Context not available. | |||||
352 | brushTypeString = i18n("Animated Image"); | 345 | brushTypeString = i18n("Animated Image"); | ||
353 | } | 346 | } | ||
354 | 347 | | |||
355 | | ||||
356 | QString brushDetailsText = QString("%1 (%2 x %3) %4") | 348 | QString brushDetailsText = QString("%1 (%2 x %3) %4") | ||
357 | .arg(brushTypeString) | 349 | .arg(brushTypeString) | ||
358 | .arg(m_brush->width()) | 350 | .arg(m_brush->width()) | ||
Context not available. | |||||
370 | m_brush->setUserEffectiveSize(brushSizeSpinBox->value()); | 362 | m_brush->setUserEffectiveSize(brushSizeSpinBox->value()); | ||
371 | } | 363 | } | ||
372 | 364 | | |||
373 | | ||||
374 | brushSpacingSelectionWidget->setSpacing(m_brush->autoSpacingActive(), | 365 | brushSpacingSelectionWidget->setSpacing(m_brush->autoSpacingActive(), | ||
375 | m_brush->autoSpacingActive() ? | 366 | m_brush->autoSpacingActive() ? | ||
376 | m_brush->autoSpacingCoeff() : m_brush->spacing()); | 367 | m_brush->autoSpacingCoeff() : m_brush->spacing()); | ||
Context not available. | |||||
378 | brushRotationSpinBox->setValue(m_brush->angle() * 180 / M_PI); | 369 | brushRotationSpinBox->setValue(m_brush->angle() * 180 / M_PI); | ||
379 | brushSizeSpinBox->setValue(m_brush->width() * m_brush->scale()); | 370 | brushSizeSpinBox->setValue(m_brush->width() * m_brush->scale()); | ||
380 | 371 | | |||
381 | | ||||
382 | // useColorAsMask support is only in gimp brush so far | 372 | // useColorAsMask support is only in gimp brush so far | ||
383 | KisGbrBrush *gimpBrush = dynamic_cast<KisGbrBrush*>(m_brush.data()); | 373 | KisGbrBrush *gimpBrush = dynamic_cast<KisGbrBrush*>(m_brush.data()); | ||
384 | if (gimpBrush) { | 374 | if (gimpBrush) { | ||
Context not available. |