|
Krita Source Code Documentation
|
The KisInternalColorSelector class. More...
#include <KisDlgInternalColorSelector.h>
Inheritance diagram for KisDlgInternalColorSelector:Classes | |
| struct | Config |
| struct | Private |
Public Slots | |
| void | reject () override |
| 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 currently active color. It's very important that this function is able to understand when the signal came from itself. | |
| void | slotSetColorFromPatch (KoColorPatch *patch) |
| slotSetColorFromPatch update current color from kocolorpatch. | |
Signals | |
| void | signalForegroundColorChosen (KoColor color) |
| signalForegroundColorChosen The most important signal. This will sent out when a color has been chosen from the selector. There will be a small delay to make sure that the selector causes too many updates. | |
Public Member Functions | |
| void | chooseAlpha (bool chooseAlpha) |
| void | colorSpaceChanged (const KoColorSpace *cs) |
| slotColorSpaceChanged Color space has changed, use this dialog to change the colorspace. | |
| KoColor | getCurrentColor () |
| getCurrentColor | |
| KisDlgInternalColorSelector (QWidget *parent, KoColor color, Config config, const QString &caption, const KoColorDisplayRendererInterface *displayRenderer=KoDumbColorDisplayRenderer::instance()) | |
| void | lockUsedColorSpace (const KoColorSpace *cs) |
| lockUsedColorSpace Lock the used colorspace of this selector. | |
| void | setDisplayRenderer (const KoColorDisplayRendererInterface *displayRenderer) |
| setDisplayRenderer Set the display renderer. This is necessary for HDR color manage support. | |
| ~KisDlgInternalColorSelector () override | |
Static Public Member Functions | |
| static KoColor | getModalColorDialog (const KoColor color, QWidget *parent=0, QString caption=QString()) |
| getModalColorDialog Execute this dialog modally. The function returns the KoColor you want. | |
| static void | setScreenColorSamplerFactory (std::function< KisScreenColorSamplerBase *(QWidget *)> f) |
Protected Member Functions | |
| void | showEvent (QShowEvent *event) override |
Private Slots | |
| void | endUpdateWithNewColor () |
| void | slotChangePalette (KoColorSetSP set) |
| void | slotFinishUp () |
| slotFinishUp This is called when the selector is closed, for saving the current palette. | |
| void | slotSelectorModelChanged () |
| void | slotSetColorFromHex () |
| slotSetColorFromHex Update from the hex color input. | |
Private Member Functions | |
| void | focusInEvent (QFocusEvent *) override |
| void | updateAllElements (QObject *source) |
| updateAllElements Updates each widget with the new element, and if it's responsible for the update sents a signal out that there's a new color. | |
Private Attributes | |
| const QScopedPointer< Private > | m_d |
| Ui_WdgDlgInternalColorSelector * | m_ui |
Static Private Attributes | |
| static std::function< KisScreenColorSamplerBase *(QWidget *) | s_screenColorSamplerFactory ) |
The KisInternalColorSelector class.
A non-modal color selector dialog that is not a plugin and can thus be used for filters.
Definition at line 29 of file KisDlgInternalColorSelector.h.
| KisDlgInternalColorSelector::KisDlgInternalColorSelector | ( | QWidget * | parent, |
| KoColor | color, | ||
| Config | config, | ||
| const QString & | caption, | ||
| const KoColorDisplayRendererInterface * | displayRenderer = KoDumbColorDisplayRenderer::instance() ) |
Definition at line 57 of file KisDlgInternalColorSelector.cpp.
References KoColor::colorSpace(), connect(), endUpdateWithNewColor(), KoResourceServer< T >::firstResource(), KisDlgInternalColorSelector::Config::hexInput, KisConfigNotifier::instance(), KoResourceServerProvider::instance(), KisIconUtils::loadIcon(), m_d, m_ui, KisDlgInternalColorSelector::Config::modal, KisDlgInternalColorSelector::Config::paletteBox, KoResourceServerProvider::paletteServer, KisSignalCompressor::POSTPONE, KisDlgInternalColorSelector::Config::prevNextButtons, reject(), KoResourceServer< T >::resource(), KoResourceServer< T >::resourceCount(), s_screenColorSamplerFactory, KisDlgInternalColorSelector::Config::screenColorSampler, slotChangePalette(), slotColorUpdated(), slotFinishUp(), slotSelectorModelChanged(), slotSetColorFromHex(), slotSetColorFromPatch(), and KisDlgInternalColorSelector::Config::visualColorSelector.
|
override |
Definition at line 171 of file KisDlgInternalColorSelector.cpp.
References m_ui.
| void KisDlgInternalColorSelector::chooseAlpha | ( | bool | chooseAlpha | ) |
Definition at line 257 of file KisDlgInternalColorSelector.cpp.
References chooseAlpha(), and m_d.
| void KisDlgInternalColorSelector::colorSpaceChanged | ( | const KoColorSpace * | cs | ) |
slotColorSpaceChanged Color space has changed, use this dialog to change the colorspace.
Definition at line 207 of file KisDlgInternalColorSelector.cpp.
References KoColorSpace::colorDepthId(), KoColorSpace::colorModelId(), KoColorSpaceRegistry::colorSpace(), KoID::id(), KoColorSpaceRegistry::instance(), m_d, m_ui, and KoColorSpace::profile().
|
privateslot |
Definition at line 341 of file KisDlgInternalColorSelector.cpp.
References m_d, and signalForegroundColorChosen().
|
overrideprivate |
Definition at line 347 of file KisDlgInternalColorSelector.cpp.
| KoColor KisDlgInternalColorSelector::getCurrentColor | ( | ) |
getCurrentColor
Definition at line 252 of file KisDlgInternalColorSelector.cpp.
References m_d.
|
static |
getModalColorDialog Execute this dialog modally. The function returns the KoColor you want.
| color | - The current color. Make sure this is in the color space you want your end color to be in. |
| parent | parent widget. |
| caption | the dialog caption. |
Definition at line 243 of file KisDlgInternalColorSelector.cpp.
| void KisDlgInternalColorSelector::lockUsedColorSpace | ( | const KoColorSpace * | cs | ) |
lockUsedColorSpace Lock the used colorspace of this selector.
| cs |
Definition at line 219 of file KisDlgInternalColorSelector.cpp.
References colorSpaceChanged(), m_d, and m_ui.
|
overrideslot |
Definition at line 267 of file KisDlgInternalColorSelector.cpp.
References m_d, and slotColorUpdated().
| void KisDlgInternalColorSelector::setDisplayRenderer | ( | const KoColorDisplayRendererInterface * | displayRenderer | ) |
setDisplayRenderer Set the display renderer. This is necessary for HDR color manage support.
| displayRenderer |
Definition at line 230 of file KisDlgInternalColorSelector.cpp.
References KoDumbColorDisplayRenderer::instance(), m_d, and m_ui.
setPreviousColor set the previous color.
Definition at line 262 of file KisDlgInternalColorSelector.cpp.
References m_d.
|
inlinestatic |
Definition at line 37 of file KisDlgInternalColorSelector.h.
|
overrideprotected |
Definition at line 377 of file KisDlgInternalColorSelector.cpp.
References updateAllElements().
signalForegroundColorChosen The most important signal. This will sent out when a color has been chosen from the selector. There will be a small delay to make sure that the selector causes too many updates.
Do not connect this to slotColorUpdated.
| color | The new color chosen |
|
privateslot |
Definition at line 369 of file KisDlgInternalColorSelector.cpp.
References m_d.
slotColorUpdated Very important slot. Is connected to krita's resources to make sure it has the currently active color. It's very important that this function is able to understand when the signal came from itself.
| newColor | This is the new color. |
Definition at line 176 of file KisDlgInternalColorSelector.cpp.
References KoColor::colorSpace(), colorSpaceChanged(), KoColor::convertTo(), m_d, m_ui, and updateAllElements().
|
privateslot |
slotFinishUp This is called when the selector is closed, for saving the current palette.
Definition at line 352 of file KisDlgInternalColorSelector.cpp.
References m_d, and setPreviousColor().
|
privateslot |
Definition at line 307 of file KisDlgInternalColorSelector.cpp.
References KisVisualColorModel::HSI, KisVisualColorModel::HSL, KisVisualColorModel::HSV, KisVisualColorModel::HSY, m_d, and m_ui.
|
privateslot |
slotSetColorFromHex Update from the hex color input.
Definition at line 364 of file KisDlgInternalColorSelector.cpp.
References m_d, and slotColorUpdated().
|
slot |
slotSetColorFromPatch update current color from kocolorpatch.
| patch |
Definition at line 202 of file KisDlgInternalColorSelector.cpp.
References KoColorPatch::color(), and slotColorUpdated().
|
private |
updateAllElements Updates each widget with the new element, and if it's responsible for the update sents a signal out that there's a new color.
Definition at line 273 of file KisDlgInternalColorSelector.cpp.
|
private |
Definition at line 173 of file KisDlgInternalColorSelector.h.
|
private |
Definition at line 171 of file KisDlgInternalColorSelector.h.
|
staticprivate |
Definition at line 33 of file KisDlgInternalColorSelector.h.