14#include <QPlainTextEdit>
17#include <klocalizedstring.h>
43 :
KoDialog(view->mainWindowAsQWidget())
51 setCaption(i18nc(
"@title:window",
"Stroke Selection Properties"));
61 m_options.
color = cfg->getColor(
"color");
72 m_options.
customColor = cfg->getColor(
"customColor");
81 m_options.
lineSize = cfg->getInt(
"lineSize", 1);
105 cfg->setProperty(
"lineSize", m_options.
lineSize);
106 cfg->setProperty(
"colorFillSource",
static_cast<int>(m_options.
colorFillSource));
109 cfg->setProperty(
"lineColorSource",
static_cast<int>(m_options.
colorLineSource));
111 QVariant colorVariant;
113 cfg->setProperty(
"customColor", colorVariant);
115 colorVariant.setValue(m_options.
color);
116 cfg->setProperty(
"color", colorVariant);
118 colorVariant.setValue(m_options.
fillColor);
119 cfg->setProperty(
"fillColor", colorVariant);
131 switch(currentSource) {
146 switch (currentSource) {
196 if (
m_page->sizeBox->currentIndex() == 0) {
199 else if (
m_page->sizeBox->currentIndex() == 1) {
231 m_page->colorFillSelector->setColor(newColor);
238 if (tempColor.toQColor() ==
FGColor.toQColor()) {
241 else if (tempColor.toQColor() ==
BGColor.toQColor()) {
259 if (tempColor.toQColor() ==
FGColor.toQColor()) {
263 else if (tempColor.toQColor() ==
BGColor.toQColor()) {
266 else if (
PaintColor.toQColor() != tempColor.toQColor() ) {
285 colorFillSelector->setEnabled(
false);
288 colorFillSelector->setEnabled(
true);
292 typeBox->setCurrentIndex(1);
293 typeBox->setEnabled(
false);
296 typeBox->setEnabled(
true);
305 colorFillSelector->setDisabled(
true);
308 colorFillSelector->setDisabled(
false);
318 lineSize->setEnabled(
false);
319 fillBox->setEnabled(
false);
320 colorFillSelector->setEnabled(
false);
321 sizeBox->setEnabled(
false);
325 lineSize->setEnabled(
true);
326 fillBox->setEnabled(
true);
327 colorFillSelector->setEnabled(
true);
328 sizeBox->setEnabled(
true);
338StrokeSelectionOptions ::StrokeSelectionOptions()
340 color.fromQColor(Qt::black);
341 fillColor.fromQColor(Qt::black);
342 customColor.fromQColor(Qt::black);
354 style = FillStyleForegroundColor;
357 style = FillStyleBackgroundColor;
360 style = FillStyleBackgroundColor;
363 style = FillStyleNone;
366 style = FillStyleBackgroundColor;
float value(const T *src, size_t ch)
connect(this, SIGNAL(optionsChanged()), this, SLOT(saveOptions()))
KisDisplayColorConverter displayColorConverter
KisPropertiesConfigurationSP exportConfiguration(const QString &filterId, bool defaultValue=false) const
void setExportConfiguration(const QString &filterId, KisPropertiesConfigurationSP properties) const
KoColor approximateFromRenderedQColor(const QColor &c) const
~KisDlgStrokeSelection() override
KoColor getFillSelectedColor() const
KoColor getSelectedColor() const
KisDlgStrokeSelection(KisImageWSP image, KisViewManager *view, bool isVectorLayer)
StrokeSelectionOptions getParams() const
bool isBrushSelected() const
LinePosition getLinePosition() const
void setColorFillButton()
KisDisplayColorConverter * m_converter
KoCanvasResourceProvider * m_resourceManager
void colorFillChanged(const QColor &newColor)
void colorChanged(const QColor &newColor)
WdgStrokeSelection * m_page
KoCanvasResourceProvider * resourceManager() const
KisMainWindow * mainWindow() const
KisCanvas2 * canvasBase() const
Return the canvas base class.
QVariant resource(int key) const
void toQColor(QColor *c) const
a convenience method for the above.
A dialog base class with standard buttons and predefined layouts.
void setMainWidget(QWidget *widget)
virtual void setCaption(const QString &caption)
void setButtons(ButtonCodes buttonMask)
void setDefaultButton(ButtonCode id)
@ Ok
Show Ok button. (this button accept()s the dialog; result set to QDialog::Accepted)
@ Cancel
Show Cancel-button. (this button reject()s the dialog; result set to QDialog::Rejected)
static qreal convertFromUnitToUnit(const qreal value, const KoUnit &fromUnit, const KoUnit &toUnit, qreal factor=1.0)
void on_lineColorBox_currentIndexChanged(int index)
void colorFillSelectorChanged()
WdgStrokeSelection(QWidget *parent)
void colorSelectorChanged()
void on_fillBox_currentIndexChanged(int index)
StrokeSelectionOptions m_options
void on_typeBox_currentIndexChanged(int index)
KisPropertiesConfigurationSP m_cfg
This file is part of the Krita application in calligra.
@ BackgroundColor
The active background color selected for this canvas.
@ ForegroundColor
The active foreground color selected for this canvas.
KisToolShapeUtils::FillStyle fillStyle() const
ColorFillSource colorFillSource
ColorLineSource colorLineSource