Krita Source Code Documentation
Loading...
Searching...
No Matches
KoDualColorButton Class Reference

A widget for selecting two related colors. More...

#include <KoDualColorButton.h>

+ Inheritance diagram for KoDualColorButton:

Classes

class  Private
 

Public Types

enum  Selection { Foreground , Background }
 

Public Slots

void backgroundSelect (bool usePlatformDialog)
 
void foregroundSelect (bool usePlatformDialog)
 
QColor getColorFromDisplayRenderer (KoColor c)
 getColorFromDisplayRenderer convenience function to get the right qcolor from the display renderer, including checking whether the display renderer actually exists.
 
void openBackgroundDialog ()
 
void openForegroundDialog ()
 
virtual void paint_icons (QPainter &painter)
 
void ResetColours ()
 
void setBackgroundColor (const KoColor &color)
 
void setColorDialogState (Selection state)
 
void setDisplayRenderer (const KoColorDisplayRendererInterface *displayRenderer=KoDumbColorDisplayRenderer::instance())
 
void setForegroundColor (const KoColor &color)
 
void setPopDialog (bool popDialog)
 
void slotColorDialogClosed ()
 
void slotSetBackgroundColorFromDialog (const KoColor color)
 
void slotSetForegroundColorFromDialog (const KoColor color)
 
void swapColours ()
 
void updateArrows ()
 

Signals

void backgroundColorChanged (const KoColor &color)
 
void foregroundColorChanged (const KoColor &color)
 

Public Member Functions

KoColor backgroundColor () const
 
KoColor foregroundColor () const
 
 KoDualColorButton (KisCanvasResourceProvider *canvasResourceProvider, const KoColorDisplayRendererInterface *displayRenderer, QWidget *parent=0, QWidget *dialogParent=0)
 
bool popDialog () const
 
QSize sizeHint () const override
 
 ~KoDualColorButton () override
 

Public Attributes

QPixmap arrowBitmap
 
QRect backgroundRect = QRect( 14, 14, 28, 28)
 
QRect foregroundRect = QRect( 0, 0, 14, 14)
 
QPixmap resetArrowPixmap
 
bool resetColours = false
 
QPixmap resetPixmap
 

Protected Member Functions

void changeEvent (QEvent *event) override
 
void dragEnterEvent (QDragEnterEvent *event) override
 
void dropEvent (QDropEvent *event) override
 
bool event (QEvent *event) override
 
virtual void mouseMoveEvent (QMouseEvent *event) override
 
virtual void mousePressEvent (QMouseEvent *event) override
 
virtual void mouseReleaseEvent (QMouseEvent *event) override
 
void paintEvent (QPaintEvent *event) override
 

Properties

KoColor backgroundColor
 
KoColor foregroundColor
 
bool popDialog
 

Private Slots

void updateColorSpace ()
 updateColorSpace() from the current display renderer set ColorSpace so we can lock the selector. Right now this'll be changed per view-change.
 

Private Attributes

Private *const d
 

Detailed Description

A widget for selecting two related colors.

KoDualColorButton allows the user to select two cascaded colors (usually a foreground and background color). Other features include drag and drop from other KDE color widgets, a reset to black and white control, and a swap colors control.

When the user clicks on the foreground or background rectangle the rectangle is first sunken and the selectionChanged() signal is emitted. Further clicks will present a color dialog and Q_EMIT either the foregroundColorChanged() or backgroundColorChanged() if a new color is selected.

Note: With drag and drop when dropping a color the current selected color will be set, while when dragging a color it will use whatever color rectangle the mouse was pressed inside.

Author
Daniel M. Duley mosfe.nosp@m.t@kd.nosp@m.e.org

Definition at line 41 of file KoDualColorButton.h.

Member Enumeration Documentation

◆ Selection

Enumerator
Foreground 
Background 

Definition at line 51 of file KoDualColorButton.h.

Constructor & Destructor Documentation

◆ KoDualColorButton()

KoDualColorButton::KoDualColorButton ( KisCanvasResourceProvider * canvasResourceProvider,
const KoColorDisplayRendererInterface * displayRenderer,
QWidget * parent = 0,
QWidget * dialogParent = 0 )

Constructs a new KoDualColorButton with the supplied foreground and background colors.

Parameters
parentThe parent widget of the KoDualColorButton.
dialogParentThe parent widget of the color selection dialog.

Definition at line 85 of file KoDualColorButton.cpp.

88 : QWidget( parent ),
89 d( new Private(canvasResourceProvider->fgColor(),canvasResourceProvider->bgColor(),
90 dialogParent,
91 displayRenderer) )
92{
93 d->init(this);
94}
void init(KoDualColorButton *q)

References d, and KoDualColorButton::Private::init().

◆ ~KoDualColorButton()

KoDualColorButton::~KoDualColorButton ( )
override

Destroys the KoDualColorButton.

Definition at line 96 of file KoDualColorButton.cpp.

97{
98 delete d;
99}

References d.

Member Function Documentation

◆ backgroundColor()

KoColor KoDualColorButton::backgroundColor ( ) const

Returns the current background color.

Definition at line 135 of file KoDualColorButton.cpp.

136{
137 return d->backgroundColor;
138}

References KoDualColorButton::Private::backgroundColor, and d.

◆ backgroundColorChanged

void KoDualColorButton::backgroundColorChanged ( const KoColor & color)
signal

Emitted when the background color is changed.

◆ backgroundSelect

void KoDualColorButton::backgroundSelect ( bool usePlatformDialog)
slot

Definition at line 316 of file KoDualColorButton.cpp.

317{
318 if( d->popDialog) {
319 if (usePlatformDialog) {
320 QColor c = d->backgroundColor.toQColor();
321 c = QColorDialog::getColor(c, this);
322 if (c.isValid()) {
323 d->backgroundColor = d->displayRenderer->approximateFromRenderedQColor(c);
325 }
326 }
327 else {
329 }
330 }
331}
void toQColor(QColor *c) const
a convenience method for the above.
Definition KoColor.cpp:198
QPointer< const KoColorDisplayRendererInterface > displayRenderer
void backgroundColorChanged(const KoColor &color)

References KoDualColorButton::Private::backgroundColor, backgroundColorChanged(), d, KoDualColorButton::Private::displayRenderer, openBackgroundDialog(), KoDualColorButton::Private::popDialog, and KoColor::toQColor().

◆ changeEvent()

void KoDualColorButton::changeEvent ( QEvent * event)
overrideprotected

Definition at line 451 of file KoDualColorButton.cpp.

452{
453 QWidget::changeEvent(event);
454
455 switch (event->type()) {
456 case QEvent::StyleChange:
457 case QEvent::PaletteChange:
458 updateArrows();
459 default:
460 break;
461 }
462}
bool event(QEvent *event) override

References event(), and updateArrows().

◆ dragEnterEvent()

void KoDualColorButton::dragEnterEvent ( QDragEnterEvent * event)
overrideprotected

Definition at line 261 of file KoDualColorButton.cpp.

262{
263 event->setAccepted( isEnabled() && KColorMimeData::canDecode( event->mimeData() ) );
264}

References event().

◆ dropEvent()

void KoDualColorButton::dropEvent ( QDropEvent * event)
overrideprotected

Definition at line 266 of file KoDualColorButton.cpp.

267{
268 Q_UNUSED(event);
269}

References event().

◆ event()

bool KoDualColorButton::event ( QEvent * event)
overrideprotected

Definition at line 464 of file KoDualColorButton.cpp.

465{
466 if (event->type() == QEvent::ToolTip) {
467
468 const QHelpEvent *helpEvent = static_cast<QHelpEvent*>(event);
469
470 if (this->mapFromGlobal(helpEvent->globalPos()).x() < backgroundRect.x() ) {
471 if (this->mapFromGlobal(helpEvent->globalPos()).y() < backgroundRect.y()){
472 this->setToolTip(i18n("Foreground color selector"));
473 }
474 else{
475 this->setToolTip(i18n("Set foreground and background colors to black and white"));
476 }
477 }
478 else {
479 if (this->mapFromGlobal(helpEvent->globalPos()).y() < backgroundRect.y() ) {
480 this->setToolTip(i18n("Swap foreground and background colors"));
481 }
482 else{
483 this->setToolTip(i18n("Background color selector"));
484 }
485 }
486 }
487 return QWidget::event(event);
488
489}

References backgroundRect, and event().

◆ foregroundColor()

KoColor KoDualColorButton::foregroundColor ( ) const

Returns the current foreground color.

Definition at line 130 of file KoDualColorButton.cpp.

131{
132 return d->foregroundColor;
133}

References d, and KoDualColorButton::Private::foregroundColor.

◆ foregroundColorChanged

void KoDualColorButton::foregroundColorChanged ( const KoColor & color)
signal

Emitted when the foreground color is changed.

◆ foregroundSelect

void KoDualColorButton::foregroundSelect ( bool usePlatformDialog)
slot

Definition at line 333 of file KoDualColorButton.cpp.

334{
335 if( d->popDialog) {
336 if (usePlatformDialog) {
337 QColor c = d->foregroundColor.toQColor();
338 c = QColorDialog::getColor(c, this);
339 if (c.isValid()) {
340 d->foregroundColor = d->displayRenderer->approximateFromRenderedQColor(c);
342 }
343 }
344 else {
346 }
347 }
348}
void foregroundColorChanged(const KoColor &color)

References d, KoDualColorButton::Private::displayRenderer, KoDualColorButton::Private::foregroundColor, foregroundColorChanged(), openForegroundDialog(), KoDualColorButton::Private::popDialog, and KoColor::toQColor().

◆ getColorFromDisplayRenderer

QColor KoDualColorButton::getColorFromDisplayRenderer ( KoColor c)
slot

getColorFromDisplayRenderer convenience function to get the right qcolor from the display renderer, including checking whether the display renderer actually exists.

Parameters
cthe kocolor to convert.
Returns
the qcolor to use for display.

Definition at line 212 of file KoDualColorButton.cpp.

213{
214 QColor col;
215 if (d->displayRenderer) {
216 c.convertTo(d->displayRenderer->getPaintingColorSpace());
217 col = d->displayRenderer->toQColor(c);
218 } else {
219 col = c.toQColor();
220 }
221 return col;
222}
void convertTo(const KoColorSpace *cs, KoColorConversionTransformation::Intent renderingIntent, KoColorConversionTransformation::ConversionFlags conversionFlags)
Definition KoColor.cpp:136

References KoColor::convertTo(), d, KoDualColorButton::Private::displayRenderer, and KoColor::toQColor().

◆ mouseMoveEvent()

void KoDualColorButton::mouseMoveEvent ( QMouseEvent * event)
overrideprotectedvirtual

Reimplemented in KoResetBgFgColours, and KoSwapBgFgColours.

Definition at line 398 of file KoDualColorButton.cpp.

399{
400 if ( !d->miniCtlFlag ) {
401 int delay = QApplication::startDragDistance();
402
403 if ( event->x() >= d->dragPosition.x() + delay || event->x() <= d->dragPosition.x() - delay ||
404 event->y() >= d->dragPosition.y() + delay || event->y() <= d->dragPosition.y() - delay ) {
405 KColorMimeData::createDrag( d->tmpSelection == Foreground ?
408 this )->exec();
409 d->dragFlag = true;
410 }
411 }
412}
QColor getColorFromDisplayRenderer(KoColor c)
getColorFromDisplayRenderer convenience function to get the right qcolor from the display renderer,...

References KoDualColorButton::Private::backgroundColor, d, KoDualColorButton::Private::dragFlag, KoDualColorButton::Private::dragPosition, event(), Foreground, KoDualColorButton::Private::foregroundColor, getColorFromDisplayRenderer(), KoDualColorButton::Private::miniCtlFlag, and KoDualColorButton::Private::tmpSelection.

◆ mousePressEvent()

void KoDualColorButton::mousePressEvent ( QMouseEvent * event)
overrideprotectedvirtual

Reimplemented in KoBackgroundColour, KoForegroundColour, KoResetBgFgColours, and KoSwapBgFgColours.

Definition at line 350 of file KoDualColorButton.cpp.

351{
352
353 d->dragPosition = event->pos();
354
355 d->dragFlag = false;
356
357 if ( foregroundRect.contains( d->dragPosition ) ) {
359 d->miniCtlFlag = false;
360 }
361 else if( backgroundRect.contains( d->dragPosition ) ) {
363 d->miniCtlFlag = false;
364 }
365 else if ( event->pos().x() > foregroundRect.width() ) {
366 swapColours();
367
368 d->miniCtlFlag = true;
369 }
370 else if ( event->pos().x() < backgroundRect.x() ) {
371 ResetColours();
372
373 d->miniCtlFlag = true;
374 }
375 update();
376}
bool update(QSpinBox *spinBox)

References Background, backgroundRect, d, KoDualColorButton::Private::dragFlag, KoDualColorButton::Private::dragPosition, event(), Foreground, foregroundRect, KoDualColorButton::Private::miniCtlFlag, ResetColours(), swapColours(), and KoDualColorButton::Private::tmpSelection.

◆ mouseReleaseEvent()

void KoDualColorButton::mouseReleaseEvent ( QMouseEvent * event)
overrideprotectedvirtual

Reimplemented in KoBackgroundColour, KoForegroundColour, KoResetBgFgColours, and KoSwapBgFgColours.

Definition at line 414 of file KoDualColorButton.cpp.

415{
416 d->dragFlag = false;
417
418 if ( d->miniCtlFlag )
419 return;
420
421 d->miniCtlFlag = false;
422
423
424 KConfigGroup cfg = KSharedConfig::openConfig()->group("colorselector");
425 bool usePlatformDialog = cfg.readEntry("UsePlatformColorDialog", false);
426
427 if (foregroundRect.contains( event->pos())) {
428 if (d->tmpSelection == Foreground) {
429 foregroundSelect(usePlatformDialog);
430 }
431 else {
434 }
435 }
436 else if (backgroundRect.contains( event->pos())) {
437 if(d->tmpSelection == Background ) {
438 backgroundSelect(usePlatformDialog);
439 } else {
442 }
443 }
444
445 update();
446}
void backgroundSelect(bool usePlatformDialog)
void foregroundSelect(bool usePlatformDialog)

References Background, KoDualColorButton::Private::backgroundColor, backgroundColorChanged(), backgroundRect, backgroundSelect(), d, KoDualColorButton::Private::dragFlag, event(), Foreground, KoDualColorButton::Private::foregroundColor, foregroundColorChanged(), foregroundRect, foregroundSelect(), KoDualColorButton::Private::miniCtlFlag, and KoDualColorButton::Private::tmpSelection.

◆ openBackgroundDialog

void KoDualColorButton::openBackgroundDialog ( )
slot

Definition at line 303 of file KoDualColorButton.cpp.

304{
305 d->colorDialogState.emplace();
306 d->colorDialogState->selection = Background;
307 // TODO: fix cyclic connections in a proper way
308 d->colorDialogState->connections.addUniqueConnection(d->colorSelectorDialog, SIGNAL(signalForegroundColorChosen(KoColor)), this, SLOT(slotSetBackgroundColorFromDialog(KoColor)));
309 d->colorDialogState->connections.addUniqueConnection(this, SIGNAL(backgroundColorChanged(KoColor)), d->colorSelectorDialog, SLOT(slotColorUpdated(KoColor)));
312 d->colorSelectorDialog->show();
313 update();
314}
void setPreviousColor(KoColor c)
setPreviousColor set the previous color.
void slotColorUpdated(KoColor newColor)
slotColorUpdated Very important slot. Is connected to krita's resources to make sure it has the curre...
KisDlgInternalColorSelector * colorSelectorDialog
std::optional< ColorDialogState > colorDialogState
void slotSetBackgroundColorFromDialog(const KoColor color)

References Background, KoDualColorButton::Private::backgroundColor, backgroundColorChanged(), KoDualColorButton::Private::colorDialogState, KoDualColorButton::Private::colorSelectorDialog, d, KisDlgInternalColorSelector::setPreviousColor(), KisDlgInternalColorSelector::slotColorUpdated(), and slotSetBackgroundColorFromDialog().

◆ openForegroundDialog

void KoDualColorButton::openForegroundDialog ( )
slot

◆ paint_icons

void KoDualColorButton::paint_icons ( QPainter & painter)
virtualslot

Reimplemented in KoBackgroundColour, KoForegroundColour, KoResetBgFgColours, and KoSwapBgFgColours.

Definition at line 255 of file KoDualColorButton.cpp.

255 {
256 painter.drawPixmap( foregroundRect.right() + 2, 1, arrowBitmap );
257 painter.drawPixmap( 1, foregroundRect.bottom() + 2, resetPixmap );
258}

References arrowBitmap, foregroundRect, and resetPixmap.

◆ paintEvent()

void KoDualColorButton::paintEvent ( QPaintEvent * event)
overrideprotected

Sets the supplied rectangles to the proper size and position for the current widget size. You can reimplement this to change the layout of the widget. Restrictions are that the swap control will always be at the top right, the reset control will always be at the bottom left, and you must leave at least a 14x14 space in those corners.

Definition at line 229 of file KoDualColorButton.cpp.

230{
231
232 QPainter painter( this );
233
234 QBrush defBrush = palette().brush( QPalette::Button );
235
236 QBrush foregroundBrush( getColorFromDisplayRenderer(d->foregroundColor), Qt::SolidPattern );
237 QBrush backgroundBrush( getColorFromDisplayRenderer(d->backgroundColor), Qt::SolidPattern );
238
239 if (resetColours) {
240 foregroundBrush = Qt::black;
241 backgroundBrush = Qt::white;
242 }
243
244 qDrawShadeRect( &painter, backgroundRect, palette(), false, 1, 0,
245 isEnabled() ? &backgroundBrush : &defBrush );
246
247 qDrawShadeRect( &painter, foregroundRect, palette(), false, 1, 0,
248 isEnabled() ? &foregroundBrush : &defBrush );
249
250 painter.setPen( palette().color( QPalette::Shadow ) );
251
252 paint_icons(painter);
253}
virtual void paint_icons(QPainter &painter)

References KoDualColorButton::Private::backgroundColor, backgroundRect, d, KoDualColorButton::Private::foregroundColor, foregroundRect, getColorFromDisplayRenderer(), paint_icons(), and resetColours.

◆ popDialog()

bool KoDualColorButton::popDialog ( ) const

Returns if a dialog with a color chooser will be popped up when clicking If false then you could/should connect to the pleasePopDialog signal and pop your own dialog. Just set the current color afterwards.

Definition at line 140 of file KoDualColorButton.cpp.

141{
142 return d->popDialog;
143}

References d, and KoDualColorButton::Private::popDialog.

◆ ResetColours

void KoDualColorButton::ResetColours ( )
slot

◆ setBackgroundColor

void KoDualColorButton::setBackgroundColor ( const KoColor & color)
slot

Sets the background color.

The internal color selector might Q_EMIT the color of a different profile, so we should break this cycling dependency somehow.

Definition at line 164 of file KoDualColorButton.cpp.

References Background, KoDualColorButton::Private::backgroundColor, KoDualColorButton::Private::colorDialogState, KoDualColorButton::Private::colorSelectorDialog, d, and KisDlgInternalColorSelector::slotColorUpdated().

◆ setColorDialogState

void KoDualColorButton::setColorDialogState ( Selection state)
slot

Definition at line 123 of file KoDualColorButton.cpp.

123 {
124 if (d->colorDialogState.has_value()) {
125 d->colorDialogState->selection = state;
126 }
127 d->tmpSelection = state;
128}

References KoDualColorButton::Private::colorDialogState, d, and KoDualColorButton::Private::tmpSelection.

◆ setDisplayRenderer

void KoDualColorButton::setDisplayRenderer ( const KoColorDisplayRendererInterface * displayRenderer = KoDumbColorDisplayRenderer::instance())
slot

Definition at line 179 of file KoDualColorButton.cpp.

180{
181 if (!displayRenderer) {
182 displayRenderer = KoDumbColorDisplayRenderer::instance();
183 }
184
185 if (displayRenderer == d->displayRenderer) return;
186
187 if (d->displayRenderer) {
188 d->displayRenderer->disconnect(this);
189 }
190
191 d->displayRenderer = displayRenderer;
192
193 if (displayRenderer) {
194 d->displayRenderer = displayRenderer;
195 d->colorSelectorDialog->setDisplayRenderer(displayRenderer);
196
197 connect(d->displayRenderer, SIGNAL(displayConfigurationChanged()), this, SLOT(updateColorSpace()));
199
200 connect(d->displayRenderer, SIGNAL(destroyed()), this, SLOT(setDisplayRenderer()));
201 }
202}
void setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer)
setDisplayRenderer Set the display renderer. This is necessary for HDR color manage support.
void updateColorSpace()
updateColorSpace() from the current display renderer set ColorSpace so we can lock the selector....
void setDisplayRenderer(const KoColorDisplayRendererInterface *displayRenderer=KoDumbColorDisplayRenderer::instance())
static KoColorDisplayRendererInterface * instance()

References KoDualColorButton::Private::colorSelectorDialog, d, KoDualColorButton::Private::displayRenderer, KoDumbColorDisplayRenderer::instance(), KisDlgInternalColorSelector::setDisplayRenderer(), setDisplayRenderer(), and updateColorSpace().

◆ setForegroundColor

void KoDualColorButton::setForegroundColor ( const KoColor & color)
slot

Sets the foreground color.

The internal color selector might Q_EMIT the color of a different profile, so we should break this cycling dependency somehow.

Definition at line 150 of file KoDualColorButton.cpp.

151{
152 d->foregroundColor = color;
153 if (d->colorDialogState && d->colorDialogState->selection == Foreground) {
160 }
161 update();
162}

References KoDualColorButton::Private::colorDialogState, KoDualColorButton::Private::colorSelectorDialog, d, Foreground, KoDualColorButton::Private::foregroundColor, and KisDlgInternalColorSelector::slotColorUpdated().

◆ setPopDialog

void KoDualColorButton::setPopDialog ( bool popDialog)
slot

Sets if a dialog with a color chooser should be popped up when clicking If you set this to false then you could connect to the pleasePopDialog signal and pop your own dialog. Just set the current color afterwards.

Definition at line 224 of file KoDualColorButton.cpp.

225{
227}

References d, KoDualColorButton::Private::popDialog, and popDialog.

◆ sizeHint()

QSize KoDualColorButton::sizeHint ( ) const
override

Returns the minimum size needed to display the widget and all its controls.

Definition at line 145 of file KoDualColorButton.cpp.

146{
147 return QSize(34, 34);
148}

◆ slotColorDialogClosed

void KoDualColorButton::slotColorDialogClosed ( )
slot

Definition at line 285 of file KoDualColorButton.cpp.

286{
287 d->colorDialogState = std::nullopt;
288}

References KoDualColorButton::Private::colorDialogState, and d.

◆ slotSetBackgroundColorFromDialog

void KoDualColorButton::slotSetBackgroundColorFromDialog ( const KoColor color)
slot

Definition at line 278 of file KoDualColorButton.cpp.

279{
280 d->backgroundColor = color;
281 update();
283}

References KoDualColorButton::Private::backgroundColor, backgroundColorChanged(), and d.

◆ slotSetForegroundColorFromDialog

void KoDualColorButton::slotSetForegroundColorFromDialog ( const KoColor color)
slot

Definition at line 271 of file KoDualColorButton.cpp.

272{
273 d->foregroundColor = color;
274 update();
276}

References d, KoDualColorButton::Private::foregroundColor, and foregroundColorChanged().

◆ swapColours

◆ updateArrows

void KoDualColorButton::updateArrows ( )
slot

Definition at line 101 of file KoDualColorButton.cpp.

101 {
102 resetPixmap = QPixmap( (const char **)dcolorreset_xpm );
103
104 QColor windowText = d->dialogParent->palette().windowText().color();
105
106 arrowBitmap = KisIconUtils::loadIcon("swap_arrow").pixmap(12,12);
107
108 QPainter pen(&arrowBitmap);
109
110 pen.setCompositionMode(QPainter::CompositionMode_SourceIn);
111 pen.fillRect(arrowBitmap.rect(),windowText);
112 pen.end();
113
114 resetArrowPixmap = KisIconUtils::loadIcon("reset_arrow").pixmap(10,12);
115
116 pen.begin(&resetArrowPixmap);
117
118 pen.setCompositionMode(QPainter::CompositionMode_SourceIn);
119 pen.fillRect(resetArrowPixmap.rect(),windowText);
120 pen.end();
121}
QIcon loadIcon(const QString &name)

References arrowBitmap, d, KoDualColorButton::Private::dialogParent, KisIconUtils::loadIcon(), resetArrowPixmap, and resetPixmap.

◆ updateColorSpace

void KoDualColorButton::updateColorSpace ( )
privateslot

updateColorSpace() from the current display renderer set ColorSpace so we can lock the selector. Right now this'll be changed per view-change.

Parameters
cs

Definition at line 204 of file KoDualColorButton.cpp.

205{
206 d->colorSelectorDialog->lockUsedColorSpace(d->displayRenderer->getPaintingColorSpace());
207
208 // we need to update preview tiles, so a paint event is necessary
209 update();
210}
void lockUsedColorSpace(const KoColorSpace *cs)
lockUsedColorSpace Lock the used colorspace of this selector.

References KoDualColorButton::Private::colorSelectorDialog, d, KoDualColorButton::Private::displayRenderer, and KisDlgInternalColorSelector::lockUsedColorSpace().

Member Data Documentation

◆ arrowBitmap

QPixmap KoDualColorButton::arrowBitmap

Definition at line 59 of file KoDualColorButton.h.

◆ backgroundRect

QRect KoDualColorButton::backgroundRect = QRect( 14, 14, 28, 28)

Definition at line 56 of file KoDualColorButton.h.

◆ d

Private* const KoDualColorButton::d
private

Definition at line 195 of file KoDualColorButton.h.

◆ foregroundRect

QRect KoDualColorButton::foregroundRect = QRect( 0, 0, 14, 14)

Definition at line 55 of file KoDualColorButton.h.

◆ resetArrowPixmap

QPixmap KoDualColorButton::resetArrowPixmap

Definition at line 57 of file KoDualColorButton.h.

◆ resetColours

bool KoDualColorButton::resetColours = false

Definition at line 61 of file KoDualColorButton.h.

◆ resetPixmap

QPixmap KoDualColorButton::resetPixmap

Definition at line 58 of file KoDualColorButton.h.

Property Documentation

◆ backgroundColor

KoColor KoDualColorButton::backgroundColor
readwrite

Definition at line 46 of file KoDualColorButton.h.

◆ foregroundColor

KoColor KoDualColorButton::foregroundColor
readwrite

Definition at line 45 of file KoDualColorButton.h.

◆ popDialog

bool KoDualColorButton::popDialog
readwrite

Definition at line 47 of file KoDualColorButton.h.


The documentation for this class was generated from the following files: