|
Krita Source Code Documentation
|
Base class for all color selectors, that should support color management and zooming. More...
#include <kis_color_selector_base.h>
Inheritance diagram for KisColorSelectorBase:Public Types | |
| enum | Move { MoveToMousePosition , DontMove } |
Public Slots | |
| virtual void | reset () |
| virtual void | showPopup (Move move=MoveToMousePosition) |
| virtual void | updateSettings () |
Public Member Functions | |
| const KoColorSpace * | colorSpace () const |
| KisDisplayColorConverter * | converter () const |
| void | enterEvent (QEnterEvent *e) override |
| KisColorSelectorBase (QWidget *parent=0) | |
| void | leaveEvent (QEvent *e) override |
| void | mousePressEvent (QMouseEvent *) override |
| void | mouseReleaseEvent (QMouseEvent *) override |
| virtual void | setCanvas (KisCanvas2 *canvas) |
| virtual void | setColor (const KoColor &color) |
| void | setColorSpace (const KoColorSpace *colorSpace) |
| void | setPopupBehaviour (bool onMouseOver, bool onMouseClick) |
| void | showColorPreview () |
| void | slotUpdateColorAndPreview (QPair< KoColor, Acs::ColorRole > color) |
| void | tryHideAllPopups () |
| virtual void | unsetCanvas () |
| void | updateBaseColorPreview (const KoColor &color) |
| void | updateColor (const KoColor &color, Acs::ColorRole role, bool needsExplicitColorReset) |
| void | updateColorPreview (const KoColor &color) |
| void | updatePreviousColorPreview () |
| ~KisColorSelectorBase () override | |
Protected Slots | |
| virtual void | canvasResourceChanged (int key, const QVariant &v) |
| if you overwrite this, keep in mind, that you should set the color only, if m_colorUpdateAllowed is true | |
| void | hidePopup () |
| void | updateLastUsedColorPreview (const KoColor &color) |
Protected Member Functions | |
| void | changeEvent (QEvent *event) override |
| virtual KisColorSelectorBase * | createPopup () const =0 |
| void | dragEnterEvent (QDragEnterEvent *) override |
| void | dropEvent (QDropEvent *) override |
| bool | isPopup () const |
| void | keyPressEvent (QKeyEvent *) override |
| void | mouseMoveEvent (QMouseEvent *event) override |
| void | requestUpdateColorAndPreview (const KoColor &color, Acs::ColorRole role) |
| void | setHidingTime (int time) |
| void | showEvent (QShowEvent *event) override |
Protected Attributes | |
| QPointer< KisCanvas2 > | m_canvas |
| bool | m_colorUpdateAllowed |
| bool | m_colorUpdateSelf |
| QWidget * | m_parent |
| KisColorSelectorBase * | m_popup |
Private Types | |
| typedef KisSignalCompressorWithParam< QPair< KoColor, Acs::ColorRole > > | ColorCompressorType |
Private Member Functions | |
| void | commitColor (const KoColor &koColor, Acs::ColorRole role) |
| void | lazyCreatePopup () |
Private Attributes | |
| KisColorPreviewPopup * | m_colorPreviewPopup |
| const KoColorSpace * | m_colorSpace |
| bool | m_hideOnMouseClick |
| QTimer * | m_hideTimer |
| bool | m_isPopup |
| bool | m_popupOnMouseClick |
| bool | m_popupOnMouseOver |
| QScopedPointer< ColorCompressorType > | m_updateColorCompressor |
Base class for all color selectors, that should support color management and zooming.
Definition at line 28 of file kis_color_selector_base.h.
|
private |
Definition at line 126 of file kis_color_selector_base.h.
| Enumerator | |
|---|---|
| MoveToMousePosition | |
| DontMove | |
Definition at line 32 of file kis_color_selector_base.h.
|
explicit |
Definition at line 127 of file kis_color_selector_base.cpp.
References connect(), hidePopup(), m_hideTimer, m_updateColorCompressor, and slotUpdateColorAndPreview().
|
override |
Definition at line 151 of file kis_color_selector_base.cpp.
References m_colorPreviewPopup, and m_popup.
|
protectedvirtualslot |
if you overwrite this, keep in mind, that you should set the color only, if m_colorUpdateAllowed is true
Definition at line 469 of file kis_color_selector_base.cpp.
References KoCanvasResource::BackgroundColor, KoCanvasResource::ForegroundColor, m_colorUpdateAllowed, m_colorUpdateSelf, setColor(), updateColorPreview(), and v.
|
overrideprotected |
Definition at line 565 of file kis_color_selector_base.cpp.
References hidePopup(), and m_isPopup.
| const KoColorSpace * KisColorSelectorBase::colorSpace | ( | ) | const |
Definition at line 480 of file kis_color_selector_base.cpp.
References converter(), and KisDisplayColorConverter::paintingColorSpace().
|
private |
Definition at line 442 of file kis_color_selector_base.cpp.
References Acs::Foreground, m_canvas, and m_colorUpdateAllowed.
| KisDisplayColorConverter * KisColorSelectorBase::converter | ( | ) | const |
Definition at line 535 of file kis_color_selector_base.cpp.
References KisDisplayColorConverter::dumbConverterInstance(), and m_canvas.
|
protectedpure virtual |
Implemented in KisColorHistory, KisColorSelector, KisCommonColors, KisMinimalShadeSelector, and KisMyPaintShadeSelector.
|
overrideprotected |
Definition at line 328 of file kis_color_selector_base.cpp.
|
overrideprotected |
Definition at line 336 of file kis_color_selector_base.cpp.
References Acs::Foreground, KoColorSpaceRegistry::instance(), and updateColor().
|
override |
Definition at line 273 of file kis_color_selector_base.cpp.
References kisEnsureInRect().
|
protectedslot |
Definition at line 434 of file kis_color_selector_base.cpp.
References KIS_ASSERT_RECOVER_RETURN, m_colorPreviewPopup, and m_isPopup.
|
inlineprotected |
|
overrideprotected |
Definition at line 321 of file kis_color_selector_base.cpp.
References hidePopup(), and m_isPopup.
|
private |
Definition at line 384 of file kis_color_selector_base.cpp.
References createPopup(), m_canvas, m_isPopup, m_parent, m_popup, setCanvas(), and updateSettings().
|
override |
Definition at line 315 of file kis_color_selector_base.cpp.
References tryHideAllPopups().
|
overrideprotected |
Definition at line 559 of file kis_color_selector_base.cpp.
|
override |
Definition at line 212 of file kis_color_selector_base.cpp.
References DontMove, lazyCreatePopup(), m_colorPreviewPopup, m_colorUpdateSelf, m_isPopup, m_popup, m_popupOnMouseClick, setHidingTime(), showColorPreview(), and showPopup().
|
override |
Definition at line 255 of file kis_color_selector_base.cpp.
References m_colorPreviewPopup, m_hideOnMouseClick, m_hideTimer, m_isPopup, and m_popupOnMouseOver.
|
protected |
Definition at line 361 of file kis_color_selector_base.cpp.
References m_updateColorCompressor.
|
virtualslot |
Flushes caches and redraws the selectors
Definition at line 515 of file kis_color_selector_base.cpp.
|
virtual |
Reimplemented in KisColorHistory, KisColorPatches, KisCommonColors, and KisMinimalShadeSelector.
Definition at line 175 of file kis_color_selector_base.cpp.
References canvasResourceChanged(), connect(), Acs::currentColor(), Acs::Foreground, KisCanvas2::imageView(), m_canvas, m_popup, reset(), setCanvas(), setColor(), and updateLastUsedColorPreview().
Reimplemented in KisColorSelector, KisMinimalShadeSelector, and KisMyPaintShadeSelector.
Definition at line 372 of file kis_color_selector_base.cpp.
| void KisColorSelectorBase::setColorSpace | ( | const KoColorSpace * | colorSpace | ) |
Definition at line 170 of file kis_color_selector_base.cpp.
References colorSpace(), and m_colorSpace.
|
protected |
Definition at line 377 of file kis_color_selector_base.cpp.
References KIS_ASSERT_RECOVER_NOOP, m_hideTimer, and m_isPopup.
| void KisColorSelectorBase::setPopupBehaviour | ( | bool | onMouseOver, |
| bool | onMouseClick ) |
Definition at line 157 of file kis_color_selector_base.cpp.
References m_popupOnMouseClick, and m_popupOnMouseOver.
| void KisColorSelectorBase::showColorPreview | ( | ) |
Definition at line 457 of file kis_color_selector_base.cpp.
References m_colorPreviewPopup, and KisColorPreviewPopup::show().
|
overrideprotected |
Definition at line 575 of file kis_color_selector_base.cpp.
References m_isPopup.
|
virtualslot |
Definition at line 409 of file kis_color_selector_base.cpp.
References lazyCreatePopup(), m_colorPreviewPopup, m_popup, MoveToMousePosition, and KisColorPreviewPopup::show().
| void KisColorSelectorBase::slotUpdateColorAndPreview | ( | QPair< KoColor, Acs::ColorRole > | color | ) |
Definition at line 366 of file kis_color_selector_base.cpp.
References updateColor(), and updateColorPreview().
| void KisColorSelectorBase::tryHideAllPopups | ( | ) |
Definition at line 542 of file kis_color_selector_base.cpp.
References m_colorPreviewPopup, m_colorUpdateSelf, m_hideTimer, m_isPopup, and m_popup.
|
virtual |
Reimplemented in KisColorHistory, KisColorPatches, KisCommonColors, and KisMinimalShadeSelector.
Definition at line 202 of file kis_color_selector_base.cpp.
References m_canvas, m_popup, and unsetCanvas().
Definition at line 520 of file kis_color_selector_base.cpp.
References converter(), m_colorPreviewPopup, and KisColorPreviewPopup::setBaseColor().
| void KisColorSelectorBase::updateColor | ( | const KoColor & | color, |
| Acs::ColorRole | role, | ||
| bool | needsExplicitColorReset ) |
Definition at line 352 of file kis_color_selector_base.cpp.
References commitColor(), and setColor().
Definition at line 464 of file kis_color_selector_base.cpp.
References converter(), m_colorPreviewPopup, and KisColorPreviewPopup::setQColor().
Definition at line 530 of file kis_color_selector_base.cpp.
References converter(), m_colorPreviewPopup, and KisColorPreviewPopup::setLastUsedColor().
| void KisColorSelectorBase::updatePreviousColorPreview | ( | ) |
Definition at line 525 of file kis_color_selector_base.cpp.
References m_colorPreviewPopup, and KisColorPreviewPopup::setPreviousColor().
|
virtualslot |
Definition at line 485 of file kis_color_selector_base.cpp.
References m_hideOnMouseClick, m_isPopup, m_popup, reset(), setPopupBehaviour(), and updateSettings().
|
protected |
Definition at line 109 of file kis_color_selector_base.h.
|
private |
Definition at line 124 of file kis_color_selector_base.h.
|
mutableprivate |
Definition at line 121 of file kis_color_selector_base.h.
|
protected |
Definition at line 112 of file kis_color_selector_base.h.
|
protected |
Definition at line 115 of file kis_color_selector_base.h.
|
private |
Definition at line 123 of file kis_color_selector_base.h.
|
private |
Definition at line 118 of file kis_color_selector_base.h.
|
private |
Definition at line 122 of file kis_color_selector_base.h.
|
protected |
Definition at line 111 of file kis_color_selector_base.h.
|
protected |
Definition at line 110 of file kis_color_selector_base.h.
|
private |
Definition at line 120 of file kis_color_selector_base.h.
|
private |
Definition at line 119 of file kis_color_selector_base.h.
|
private |
Definition at line 127 of file kis_color_selector_base.h.