|
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 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() ) |
We cannot use bestMatch() for fetching "Default" palette, since bestMatch() is allowed ot fetch resources from the disabled storages/bundles.
Definition at line 58 of file KisDlgInternalColorSelector.cpp.
References KoColor::colorSpace(), endUpdateWithNewColor(), KisDlgInternalColorSelector::Config::hexInput, KisConfigNotifier::instance(), KisGlobalResourcesInterface::instance(), KisIconUtils::loadIcon(), m_d, m_ui, KisDlgInternalColorSelector::Config::modal, KisDlgInternalColorSelector::Config::paletteBox, ResourceType::Palettes, KisSignalCompressor::POSTPONE, KisDlgInternalColorSelector::Config::prevNextButtons, reject(), KisResourceModel::resourcesForName(), s_screenColorSamplerFactory, KisDlgInternalColorSelector::Config::screenColorSampler, slotChangePalette(), slotColorUpdated(), slotFinishUp(), slotSelectorModelChanged(), slotSetColorFromHex(), slotSetColorFromPatch(), source(), and KisDlgInternalColorSelector::Config::visualColorSelector.
|
override |
Definition at line 191 of file KisDlgInternalColorSelector.cpp.
References m_ui.
| void KisDlgInternalColorSelector::chooseAlpha | ( | bool | chooseAlpha | ) |
Definition at line 268 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 227 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 352 of file KisDlgInternalColorSelector.cpp.
References m_d, and signalForegroundColorChosen().
|
overrideprivate |
Definition at line 358 of file KisDlgInternalColorSelector.cpp.
| KoColor KisDlgInternalColorSelector::getCurrentColor | ( | ) |
getCurrentColor
Definition at line 263 of file KisDlgInternalColorSelector.cpp.
References m_d.
| void KisDlgInternalColorSelector::lockUsedColorSpace | ( | const KoColorSpace * | cs | ) |
lockUsedColorSpace Lock the used colorspace of this selector.
| cs |
Definition at line 239 of file KisDlgInternalColorSelector.cpp.
References colorSpaceChanged(), m_d, and m_ui.
|
overrideslot |
Definition at line 278 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 250 of file KisDlgInternalColorSelector.cpp.
References KoDumbColorDisplayRenderer::instance(), m_d, and m_ui.
setPreviousColor set the previous color.
Definition at line 273 of file KisDlgInternalColorSelector.cpp.
References m_d.
|
inlinestatic |
Definition at line 37 of file KisDlgInternalColorSelector.h.
|
overrideprotected |
Definition at line 388 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 380 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 196 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 363 of file KisDlgInternalColorSelector.cpp.
References m_d, and setPreviousColor().
|
privateslot |
Definition at line 318 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 375 of file KisDlgInternalColorSelector.cpp.
References m_d, and slotColorUpdated().
|
slot |
slotSetColorFromPatch update current color from kocolorpatch.
| patch |
Definition at line 222 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 284 of file KisDlgInternalColorSelector.cpp.
|
private |
Definition at line 162 of file KisDlgInternalColorSelector.h.
|
private |
Definition at line 160 of file KisDlgInternalColorSelector.h.
|
staticprivate |
Definition at line 33 of file KisDlgInternalColorSelector.h.