|
Krita Source Code Documentation
|
#include <kis_popup_palette.h>
Inheritance diagram for KisPopupPalette:Public Slots | |
| void | slotUpdateIcons () |
Signals | |
| void | finished () override |
| void | sigChangeActivePaintop (int) |
| void | sigChangefGColor (const KoColor &) |
| void | sigUpdateCanvas () |
| void | sigUpdateRecentColor (int) |
| void | zoomLevelChanged (int) |
Signals inherited from KisPopupWidgetInterface | |
| virtual void | finished ()=0 |
| Emitted when a popup widget believes that its job is finished. | |
Public Member Functions | |
| void | dismiss () override |
| Called when you want to dismiss a popup widget. | |
| void | ensureWithinParent (const QPoint &globalPos, bool useUpperLeft) |
| KisPopupPalette (KisViewManager *, KisCoordinatesConverter *, KisFavoriteResourceManager *, const KoColorDisplayRendererInterface *displayRenderer, QWidget *parent=0) | |
| bool | onScreen () override |
| Returns whether the widget is active (on screen) or not. | |
| void | popup (const QPoint &position) override |
| Called when and where you want a widget to popup. | |
| int | selectedColor () const |
| void | setParent (QWidget *parent) |
| void | setSelectedColor (int x) |
| QSize | sizeHint () const override |
| ~KisPopupPalette () override | |
Public Member Functions inherited from KisPopupWidgetInterface | |
| virtual | ~KisPopupWidgetInterface () |
Protected Member Functions | |
| int | calculateColorIndex (QPointF position, int numColors) const |
| Calculate index of recent color in array. | |
| bool | eventFilter (QObject *, QEvent *) override |
| int | findPresetSlot (QPointF position) const |
| / find the index of the brush preset slot containing @position. | |
| int | hoveredColor () const |
| int | hoveredPreset () const |
| void | mouseMoveEvent (QMouseEvent *) override |
| void | mousePressEvent (QMouseEvent *) override |
| void | mouseReleaseEvent (QMouseEvent *) override |
| void | paintEvent (QPaintEvent *) override |
| void | resizeEvent (QResizeEvent *) override |
| void | setHoveredColor (int x) |
| void | setHoveredPreset (int x) |
| void | showEvent (QShowEvent *event) override |
| void | tabletEvent (QTabletEvent *event) override |
Properties | |
| int | hoveredColor |
| int | hoveredPreset |
| int | selectedColor |
Private Slots | |
| void | showBottomBarWidget (bool visible) |
| void | showHudWidget (bool visible) |
| void | slotConfigurationChanged () |
| void | slotDisplayConfigurationChanged () |
| void | slotEmitColorChanged () |
| void | slotExternalFgColorChanged (const KoColor &color) |
| void | slotFitToViewClicked () |
| void | slotRemoveMirrorPos () |
| void | slotSetMirrorPos () |
| void | slotSetSelectedColor (int x) |
| void | slotShowTagsPopup () |
| void | slotUpdate () |
| void | slotZoomSliderChanged (int zoom) |
| void | slotZoomSliderPressed () |
| void | slotZoomSliderReleased () |
| void | slotZoomToOneHundredPercentClicked () |
Private Member Functions | |
| void | calculatePresetLayout () |
| Determine the number of rings to distribute the presets and calculate the radius of the brush preset slots and saves the "layout" to m_cachedPresetLayout. | |
| void | calculateRotationSnapAreas () |
| QPainterPath | createPathFromPresetIndex (int index) const |
| QPainterPath | drawDonutPathAngle (int, int, int) |
| QPainterPath | drawDonutPathFull (int, int, int, int) |
| QPainterPath | drawFgBgColorIndicator (int type) const |
| QPointF | drawPointOnAngle (qreal angle, qreal radius) const |
| bool | isPointInPixmap (QPointF &, int pos) |
| void | reconfigure () |
| QRectF | rotationIndicatorRect (qreal rotationAngle) const |
Definition at line 45 of file kis_popup_palette.h.
| KisPopupPalette::KisPopupPalette | ( | KisViewManager * | viewManager, |
| KisCoordinatesConverter * | coordinatesConverter, | ||
| KisFavoriteResourceManager * | manager, | ||
| const KoColorDisplayRendererInterface * | displayRenderer, | ||
| QWidget * | parent = 0 ) |
Tablet support code generates a spurious right-click right after opening the window, so we should ignore it. Next right-click will be used for closing the popup palette
Definition at line 92 of file kis_popup_palette.cpp.
References KisKActionCollection::action(), canvasOnlyButton, KisViewManager::canvasResourceProvider(), connect(), KisAcyclicSignalConnector::connectBackwardKoColor(), KisAcyclicSignalConnector::connectForwardKoColor(), finished(), fitToViewButton, KisConfigNotifier::instance(), m_actionCollection, m_acyclicConnector, m_bottomBarButton, m_bottomBarWidget, m_clearColorHistoryButton, m_clicksEater, m_colorChangeCompressor, m_coordinatesConverter, m_displayRenderer, m_dockerHud, m_dockerHudButton, m_mainArea, m_popupPaletteSize, m_resourceManager, m_tagsButton, mirrorMode, opacityChange, reconfigure(), setHoveredColor(), setHoveredPreset(), setSelectedColor(), showBottomBarWidget(), KisConfig::showBrushHud(), showHudWidget(), KisConfig::showPaletteBottomBar(), sigChangeActivePaintop(), sigChangefGColor(), sigUpdateRecentColor(), slotConfigurationChanged(), slotDisplayConfigurationChanged(), slotEmitColorChanged(), slotExternalFgColorChanged(), slotFitToViewClicked(), slotRemoveMirrorPos(), slotSetMirrorPos(), slotSetSelectedColor(), slotShowTagsPopup(), slotUpdate(), slotUpdateIcons(), slotZoomSliderChanged(), slotZoomSliderPressed(), slotZoomSliderReleased(), slotZoomToOneHundredPercentClicked(), WIDGET_MARGIN, zoomCanvasSlider, KoZoomHandler::zoomInPercent(), zoomSliderMaxValue, zoomSliderMinValue, and zoomToOneHundredPercentButton.
|
override |
Definition at line 283 of file kis_popup_palette.cpp.
|
protected |
Calculate index of recent color in array.
| numColors | the total number of recent colors |
Definition at line 1198 of file kis_popup_palette.cpp.
References M_PI, m_popupPaletteSize, and normalizeAngle().
|
private |
Determine the number of rings to distribute the presets and calculate the radius of the brush preset slots and saves the "layout" to m_cachedPresetLayout.
Definition at line 1231 of file kis_popup_palette.cpp.
References BORDER_WIDTH, drawPointOnAngle(), CachedPresetLayout::firstRowPos, CachedPresetLayout::firstRowRadius, kisDistance(), m_cachedPresetLayout, m_colorHistoryOuterRadius, m_popupPaletteSize, m_presetRingMargin, m_presetSlotCount, m_rotationTrackSize, m_showColorHistory, m_showRotationTrack, CachedPresetLayout::ringCount, CachedPresetLayout::secondRowPos, and CachedPresetLayout::secondRowRadius.
|
private |
Definition at line 1549 of file kis_popup_palette.cpp.
References BORDER_WIDTH, drawPointOnAngle(), m_popupPaletteSize, m_rotationTrackSize, m_snapLines, m_snapRadius, and m_snapRects.
|
private |
Definition at line 1492 of file kis_popup_palette.cpp.
References CachedPresetLayout::firstRowPos, CachedPresetLayout::firstRowRadius, KIS_ASSERT, KIS_ASSERT_RECOVER_NOOP, length(), m_cachedPresetLayout, m_presetSlotCount, CachedPresetLayout::ringCount, CachedPresetLayout::secondRowPos, CachedPresetLayout::secondRowRadius, CachedPresetLayout::thirdRowPos, and CachedPresetLayout::thirdRowRadius.
|
overridevirtual |
Called when you want to dismiss a popup widget.
Implements KisPopupWidgetInterface.
Definition at line 1085 of file kis_popup_palette.cpp.
|
private |
Definition at line 786 of file kis_popup_palette.cpp.
References M_PI.
|
private |
Definition at line 776 of file kis_popup_palette.cpp.
|
private |
Definition at line 799 of file kis_popup_palette.cpp.
References m_popupPaletteSize.
|
private |
Definition at line 1221 of file kis_popup_palette.cpp.
References p.
| void KisPopupPalette::ensureWithinParent | ( | const QPoint & | globalPos, |
| bool | useUpperLeft ) |
Definition at line 1095 of file kis_popup_palette.cpp.
References kisEnsureInRect(), kisGrowRect(), and paletteSize.
|
overrideprotected |
Definition at line 980 of file kis_popup_palette.cpp.
References m_touchBeginReceived, and source().
|
protected |
/ find the index of the brush preset slot containing @position.
Definition at line 1569 of file kis_popup_palette.cpp.
References createPathFromPresetIndex(), m_popupPaletteSize, and m_presetSlotCount.
|
overridesignal |
|
protected |
|
protected |
|
private |
Definition at line 1213 of file kis_popup_palette.cpp.
References createPathFromPresetIndex(), and m_popupPaletteSize.
|
overrideprotected |
Definition at line 829 of file kis_popup_palette.cpp.
References BORDER_WIDTH, calculateColorIndex(), KisViewManager::canvasBase(), KoCanvasBase::canvasController(), drawDonutPathFull(), drawFgBgColorIndicator(), KisFavoriteResourceManager::favoritePresetNamesList(), findPresetSlot(), hoveredColor, hoveredPreset, KIS_ASSERT_RECOVER_RETURN, m_canvasRotationIndicatorRect, m_colorHistoryInnerRadius, m_colorHistoryOuterRadius, m_coordinatesConverter, m_isOverCanvasRotationIndicator, m_isOverFgBgColors, m_isOverResetCanvasRotationIndicator, m_isRotatingCanvasIndicator, M_PI, m_popupPaletteSize, m_resetCanvasRotationIndicatorRect, m_resourceManager, m_rotationSnapAngle, m_showRotationTrack, m_snapRects, m_snapRotation, m_viewManager, KisFavoriteResourceManager::recentColorsTotal(), KisCanvasController::rotateCanvas(), KisCoordinatesConverter::rotationAngle(), rotationIndicatorRect(), setHoveredColor(), setHoveredPreset(), and sigUpdateCanvas().
|
overrideprotected |
Definition at line 955 of file kis_popup_palette.cpp.
References KisViewManager::canvasBase(), KoCanvasBase::canvasController(), KIS_ASSERT_RECOVER_RETURN, m_canvasRotationIndicatorRect, m_coordinatesConverter, m_isOverCanvasRotationIndicator, m_isOverResetCanvasRotationIndicator, m_isRotatingCanvasIndicator, m_showRotationTrack, m_viewManager, KisCanvasController::rotateCanvas(), KisCoordinatesConverter::rotationAngle(), rotationIndicatorRect(), and sigUpdateCanvas().
|
overrideprotected |
We are in native and modal mode, so handle our closure ourselves
Definition at line 1147 of file kis_popup_palette.cpp.
References calculateColorIndex(), drawDonutPathFull(), finished(), hoveredPreset, m_colorHistoryInnerRadius, m_colorHistoryOuterRadius, m_isOverFgBgColors, m_isRotatingCanvasIndicator, m_popupPaletteSize, m_resourceManager, m_showColorHistory, m_viewManager, KisFavoriteResourceManager::recentColorsTotal(), sigChangeActivePaintop(), sigUpdateRecentColor(), and KisViewManager::slotToggleFgBg().
|
overridevirtual |
Returns whether the widget is active (on screen) or not.
Implements KisPopupWidgetInterface.
Definition at line 1090 of file kis_popup_palette.cpp.
|
overrideprotected |
Definition at line 560 of file kis_popup_palette.cpp.
References KisFavoriteResourceManager::bgColor(), BORDER_WIDTH, bounds, createPathFromPresetIndex(), drawDonutPathAngle(), drawDonutPathFull(), drawFgBgColorIndicator(), KisFavoriteResourceManager::favoritePresetImages(), KisColorSelectorInterface::getCurrentColor(), hoveredColor, hoveredPreset, m_canvasRotationIndicatorRect, m_colorHistoryInnerRadius, m_colorHistoryOuterRadius, m_colorSelector, m_coordinatesConverter, m_displayRenderer, m_isOverCanvasRotationIndicator, m_isOverFgBgColors, m_isOverResetCanvasRotationIndicator, m_isRotatingCanvasIndicator, m_isZoomingCanvas, m_popupPaletteSize, m_presetSlotCount, m_resetCanvasRotationIndicatorRect, m_resourceManager, m_rotationTrackSize, m_showColorHistory, m_showRotationTrack, m_snapLines, m_snapRotation, opacityChange, palette, KisFavoriteResourceManager::recentColorAt(), KisFavoriteResourceManager::recentColorsTotal(), KisCoordinatesConverter::rotationAngle(), rotationIndicatorRect(), selectedColor, and KoColorDisplayRendererInterface::toQColor().
|
overridevirtual |
Called when and where you want a widget to popup.
Implements KisPopupWidgetInterface.
Definition at line 1077 of file kis_popup_palette.cpp.
References ensureWithinParent(), KIS_SAFE_ASSERT_RECOVER_RETURN, and m_mirrorPos.
|
private |
Definition at line 293 of file kis_popup_palette.cpp.
References calculatePresetLayout(), connect(), KisConfig::favoritePresets(), finished(), KisConfigNotifier::instance(), length(), m_bottomBarButton, m_clearColorHistoryButton, m_colorChangeCompressor, m_colorHistoryInnerRadius, m_colorHistoryOuterRadius, m_colorSelector, m_displayRenderer, m_dockerHud, m_dockerHudButton, m_mainArea, m_maxPresetSlotCount, m_popupPaletteSize, m_presetRingMargin, m_presetSlotCount, m_resourceManager, m_showColorHistory, m_showRotationTrack, m_tagsButton, m_useDynamicSlotCount, KisFavoriteResourceManager::numFavoritePresets(), KisConfig::readEntry(), KisVisualColorSelector::setAcceptTabletEvents(), KisColorSelectorInterface::setConfig(), KisColorSelectorInterface::setDisplayRenderer(), slotConfigurationChanged(), and slotDisplayConfigurationChanged().
|
overrideprotected |
When popup is native, its geometry report the global position; then the popup is non-native, its geometry is in its parent's coordinate system.
Definition at line 758 of file kis_popup_palette.cpp.
References calculateRotationSnapAreas(), ensureWithinParent(), m_canvasRotationIndicatorRect, m_coordinatesConverter, m_resetCanvasRotationIndicatorRect, resizeEvent(), KisCoordinatesConverter::rotationAngle(), and rotationIndicatorRect().
|
private |
Definition at line 819 of file kis_popup_palette.cpp.
References drawPointOnAngle(), and m_popupPaletteSize.
| int KisPopupPalette::selectedColor | ( | ) | const |
|
protected |
Definition at line 480 of file kis_popup_palette.cpp.
References m_hoveredColor.
|
protected |
Definition at line 470 of file kis_popup_palette.cpp.
References m_hoveredPreset.
| void KisPopupPalette::setParent | ( | QWidget * | parent | ) |
Definition at line 548 of file kis_popup_palette.cpp.
| void KisPopupPalette::setSelectedColor | ( | int | x | ) |
Definition at line 490 of file kis_popup_palette.cpp.
References m_selectedColor.
|
privateslot |
Definition at line 538 of file kis_popup_palette.cpp.
References m_bottomBarButton, m_bottomBarWidget, and KisConfig::setShowPaletteBottomBar().
|
overrideprotected |
Definition at line 1123 of file kis_popup_palette.cpp.
References m_clicksEater, m_coordinatesConverter, KisMouseClickEater::reset(), zoomCanvasSlider, KoZoomHandler::zoomInPercent(), zoomSliderMaxValue, and zoomSliderMinValue.
|
privateslot |
Definition at line 528 of file kis_popup_palette.cpp.
References m_dockerHud, m_dockerHudButton, KisDockerHud::setIsShown(), and KisConfig::setShowBrushHud().
|
signal |
|
signal |
|
signal |
|
override |
Definition at line 553 of file kis_popup_palette.cpp.
References m_popupPaletteSize.
|
privateslot |
Definition at line 287 of file kis_popup_palette.cpp.
References reconfigure().
|
privateslot |
Definition at line 424 of file kis_popup_palette.cpp.
References KisViewManager::canvasResourceProvider(), KoColorSpace::colorChannelCount(), KisCanvasResourceProvider::fgColor(), KoColorDisplayRendererInterface::getPaintingColorSpace(), KoColorSpaceRegistry::instance(), m_colorSelector, m_displayRenderer, m_viewManager, KoColorSpaceRegistry::rgb8(), KisColorSelectorInterface::slotSetColor(), and KisColorSelectorInterface::slotSetColorSpace().
|
privateslot |
Definition at line 444 of file kis_popup_palette.cpp.
References KisColorSelectorInterface::getCurrentColor(), m_colorSelector, and sigChangefGColor().
Definition at line 437 of file kis_popup_palette.cpp.
References m_colorSelector, and KisColorSelectorInterface::slotSetColor().
|
privateslot |
Definition at line 1059 of file kis_popup_palette.cpp.
References KisKActionCollection::action(), m_actionCollection, m_coordinatesConverter, zoomCanvasSlider, and KoZoomHandler::zoomInPercent().
|
privateslot |
Definition at line 1073 of file kis_popup_palette.cpp.
References KisKActionCollection::action(), and m_actionCollection.
|
privateslot |
Definition at line 1070 of file kis_popup_palette.cpp.
References KisKActionCollection::action(), m_actionCollection, and m_mirrorPos.
|
inlineprivateslot |
|
privateslot |
Definition at line 1012 of file kis_popup_palette.cpp.
References m_resourceManager, ResourceType::PaintOpPresets, reconfigure(), KisFavoriteResourceManager::setCurrentTag(), and KisTagModel::tagForIndex().
|
privateslot |
Definition at line 452 of file kis_popup_palette.cpp.
References calculatePresetLayout(), m_canvasRotationIndicatorRect, m_coordinatesConverter, m_maxPresetSlotCount, m_presetSlotCount, m_resourceManager, m_useDynamicSlotCount, KisFavoriteResourceManager::numFavoritePresets(), KisCoordinatesConverter::rotationAngle(), and rotationIndicatorRect().
|
slot |
Definition at line 509 of file kis_popup_palette.cpp.
References KisKActionCollection::action(), fitToViewButton, KisIconUtils::loadIcon(), m_actionCollection, m_bottomBarButton, m_clearColorHistoryButton, m_dockerHud, m_dockerHudButton, m_tagsButton, KisRoundHudButton::setOnOffIcons(), KisDockerHud::slotUpdateIcons(), and zoomToOneHundredPercentButton.
|
privateslot |
Definition at line 495 of file kis_popup_palette.cpp.
References zoomLevelChanged().
|
privateslot |
Definition at line 499 of file kis_popup_palette.cpp.
References m_isZoomingCanvas.
|
privateslot |
Definition at line 504 of file kis_popup_palette.cpp.
References m_isZoomingCanvas.
|
privateslot |
Definition at line 1048 of file kis_popup_palette.cpp.
References KisKActionCollection::action(), m_actionCollection, and zoomCanvasSlider.
|
overrideprotected |
Definition at line 1138 of file kis_popup_palette.cpp.
References m_tabletRightClickPressed.
|
signal |
|
private |
Definition at line 170 of file kis_popup_palette.h.
|
private |
Definition at line 172 of file kis_popup_palette.h.
|
private |
Definition at line 145 of file kis_popup_palette.h.
|
private |
Definition at line 140 of file kis_popup_palette.h.
|
private |
Definition at line 176 of file kis_popup_palette.h.
|
private |
Definition at line 160 of file kis_popup_palette.h.
|
private |
Definition at line 149 of file kis_popup_palette.h.
|
private |
Definition at line 178 of file kis_popup_palette.h.
|
private |
Definition at line 162 of file kis_popup_palette.h.
|
private |
Definition at line 158 of file kis_popup_palette.h.
|
private |
Definition at line 182 of file kis_popup_palette.h.
|
private |
Definition at line 144 of file kis_popup_palette.h.
|
private |
Definition at line 151 of file kis_popup_palette.h.
|
private |
Definition at line 152 of file kis_popup_palette.h.
|
private |
Definition at line 142 of file kis_popup_palette.h.
|
private |
Definition at line 137 of file kis_popup_palette.h.
|
private |
Definition at line 143 of file kis_popup_palette.h.
|
private |
Definition at line 148 of file kis_popup_palette.h.
|
private |
Definition at line 161 of file kis_popup_palette.h.
|
private |
Definition at line 126 of file kis_popup_palette.h.
|
private |
Definition at line 124 of file kis_popup_palette.h.
|
private |
Definition at line 164 of file kis_popup_palette.h.
|
private |
Definition at line 130 of file kis_popup_palette.h.
|
private |
Definition at line 165 of file kis_popup_palette.h.
|
private |
Definition at line 166 of file kis_popup_palette.h.
|
private |
Definition at line 167 of file kis_popup_palette.h.
|
private |
Definition at line 147 of file kis_popup_palette.h.
|
private |
Definition at line 122 of file kis_popup_palette.h.
|
private |
Definition at line 121 of file kis_popup_palette.h.
|
private |
Definition at line 150 of file kis_popup_palette.h.
|
private |
Definition at line 156 of file kis_popup_palette.h.
|
private |
Definition at line 123 of file kis_popup_palette.h.
|
private |
Definition at line 163 of file kis_popup_palette.h.
|
private |
Definition at line 141 of file kis_popup_palette.h.
|
private |
Definition at line 132 of file kis_popup_palette.h.
|
private |
Definition at line 154 of file kis_popup_palette.h.
|
private |
Definition at line 127 of file kis_popup_palette.h.
|
private |
Definition at line 153 of file kis_popup_palette.h.
|
private |
Definition at line 155 of file kis_popup_palette.h.
|
private |
Definition at line 135 of file kis_popup_palette.h.
|
private |
Definition at line 133 of file kis_popup_palette.h.
|
private |
Definition at line 134 of file kis_popup_palette.h.
|
private |
Definition at line 131 of file kis_popup_palette.h.
|
private |
Definition at line 128 of file kis_popup_palette.h.
|
private |
Definition at line 159 of file kis_popup_palette.h.
|
private |
Definition at line 129 of file kis_popup_palette.h.
|
private |
Definition at line 125 of file kis_popup_palette.h.
|
private |
Definition at line 139 of file kis_popup_palette.h.
|
private |
Definition at line 169 of file kis_popup_palette.h.
|
private |
Definition at line 181 of file kis_popup_palette.h.
|
private |
Definition at line 173 of file kis_popup_palette.h.
|
private |
Definition at line 175 of file kis_popup_palette.h.
|
private |
Definition at line 174 of file kis_popup_palette.h.
|
private |
Definition at line 171 of file kis_popup_palette.h.
|
readwrite |
Definition at line 51 of file kis_popup_palette.h.
|
readwrite |
Definition at line 50 of file kis_popup_palette.h.
|
readwrite |
Definition at line 52 of file kis_popup_palette.h.