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

#include <KoForegroundColour.h>

+ Inheritance diagram for KoForegroundColour:

Public Member Functions

bool event (QEvent *event) override
 
 KoForegroundColour (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 KoForegroundColour.h.

Constructor & Destructor Documentation

◆ KoForegroundColour()

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

Definition at line 14 of file KoForegroundColour.cpp.

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

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

Member Function Documentation

◆ event()

bool KoForegroundColour::event ( QEvent * event)
override

Definition at line 47 of file KoForegroundColour.cpp.

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

References event().

◆ mousePressEvent()

void KoForegroundColour::mousePressEvent ( QMouseEvent * event)
overridevirtual

Reimplemented from KoDualColorButton.

Definition at line 30 of file KoForegroundColour.cpp.

31{
32 Q_UNUSED(event);
33}

References event().

◆ mouseReleaseEvent()

void KoForegroundColour::mouseReleaseEvent ( QMouseEvent * event)
overridevirtual

Reimplemented from KoDualColorButton.

Definition at line 35 of file KoForegroundColour.cpp.

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

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

◆ paint_icons()

void KoForegroundColour::paint_icons ( QPainter & painter)
overridevirtual

Reimplemented from KoDualColorButton.

Definition at line 25 of file KoForegroundColour.cpp.

26{
27 Q_UNUSED(painter);
28}

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