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

#include <KoBackgroundColour.h>

+ Inheritance diagram for KoBackgroundColour:

Public Member Functions

bool event (QEvent *event) override
 
 KoBackgroundColour (KisCanvasResourceProvider *canvasResourceProvider, const KoColorDisplayRendererInterface *displayRenderer=0, QWidget *parent=0, QWidget *dialogParent=0)
 
void mousePressEvent (QMouseEvent *event) override
 
void mouseReleaseEvent (QMouseEvent *event) override
 
void paint_icons (QPainter &painter) override
 
- Public Member Functions inherited from KoDualColorButton
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
 

Additional Inherited Members

- Public Types inherited from KoDualColorButton
enum  Selection { Foreground , Background }
 
- Public Slots inherited from KoDualColorButton
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 ()
 
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 ()
 
void updateColorSpace ()
 setColorSpace set ColorSpace so we can lock the selector. Right now this'll be changed per view-change.
 
- Signals inherited from KoDualColorButton
void backgroundColorChanged (const KoColor &color)
 
void foregroundColorChanged (const KoColor &color)
 
- Public Attributes inherited from KoDualColorButton
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 inherited from KoDualColorButton
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
 
void paintEvent (QPaintEvent *event) override
 
- Properties inherited from KoDualColorButton
KoColor backgroundColor
 
KoColor foregroundColor
 
bool popDialog
 

Detailed Description

Definition at line 16 of file KoBackgroundColour.h.

Constructor & Destructor Documentation

◆ KoBackgroundColour()

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

Definition at line 15 of file KoBackgroundColour.cpp.

18 : KoDualColorButton(canvasResourceProvider, displayRenderer, parent, dialogParent)
19{
20 foregroundRect = QRect( 0, 0, 12, 12);
21 backgroundRect = QRect( 6, 6, 22, 22);
23}
KoDualColorButton(KisCanvasResourceProvider *canvasResourceProvider, const KoColorDisplayRendererInterface *displayRenderer, QWidget *parent=0, QWidget *dialogParent=0)
void setColorDialogState(Selection state)

References KoDualColorButton::Background, KoDualColorButton::backgroundRect, KoDualColorButton::foregroundRect, and KoDualColorButton::setColorDialogState().

Member Function Documentation

◆ event()

bool KoBackgroundColour::event ( QEvent * event)
override

Definition at line 48 of file KoBackgroundColour.cpp.

49{
50 if (event->type() == QEvent::ToolTip) {
51 this->setToolTip(i18n("Background color selector"));
52 }
53 return QWidget::event(event);
54}
bool event(QEvent *event) override

References event().

◆ mousePressEvent()

void KoBackgroundColour::mousePressEvent ( QMouseEvent * event)
overridevirtual

Reimplemented from KoDualColorButton.

Definition at line 31 of file KoBackgroundColour.cpp.

32{
33 Q_UNUSED(event);
34}

References event().

◆ mouseReleaseEvent()

void KoBackgroundColour::mouseReleaseEvent ( QMouseEvent * event)
overridevirtual

Reimplemented from KoDualColorButton.

Definition at line 36 of file KoBackgroundColour.cpp.

37{
38 Q_UNUSED(event);
39
40 KConfigGroup cfg = KSharedConfig::openConfig()->group("colorselector");
41 bool usePlatformDialog = cfg.readEntry("UsePlatformColorDialog", false);
42
43 backgroundSelect(usePlatformDialog);
44
45 update();
46}
void backgroundSelect(bool usePlatformDialog)
bool update(QSpinBox *spinBox)

References KoDualColorButton::backgroundSelect(), and event().

◆ paint_icons()

void KoBackgroundColour::paint_icons ( QPainter & painter)
overridevirtual

Reimplemented from KoDualColorButton.

Definition at line 26 of file KoBackgroundColour.cpp.

27{
28 Q_UNUSED(painter);
29}

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