|
Krita Source Code Documentation
|
#include <LayerBox.h>
Inheritance diagram for LayerBox:Signals | |
| void | imageChanged () |
Public Member Functions | |
| LayerBox () | |
| QString | observerName () override |
| void | setCanvas (KoCanvasBase *canvas) override |
| void | setViewManager (KisViewManager *kisview) override |
| reimplemented from KisMainwindowObserver | |
| void | unsetCanvas () override |
| ~LayerBox () override | |
Public Member Functions inherited from KisMainwindowObserver | |
| KisMainwindowObserver () | |
| ~KisMainwindowObserver () override | |
Public Member Functions inherited from KoCanvasObserverBase | |
| KoCanvasObserverBase () | |
| KoCanvasBase * | observedCanvas () const |
| void | setObservedCanvas (KoCanvasBase *canvas) |
| void | unsetObservedCanvas () |
| virtual | ~KoCanvasObserverBase () |
Protected Member Functions | |
| void | hideEvent (QHideEvent *event) override |
| void | showEvent (QShowEvent *event) override |
Private Member Functions | |
| void | addActionToMenu (QMenu *menu, const QString &id) |
| void | connectActionToButton (KisViewManager *view, QAbstractButton *button, const QString &id) |
| qint32 | convertOpacityToInt (qreal opacity) |
| KisNodeSP | findNonHidableNode (KisNodeSP startNode) |
A widget that shows a visualization of the layer structure.
The center of the layer box is KisNodeModel, which shows the actual layers. This widget adds docking functionality and command buttons.
Definition at line 63 of file LayerBox.h.
| LayerBox::LayerBox | ( | ) |
Connect model updateUI() to enable/disable controls. Note: nodeActivated() is connected separately in setImage(), because it needs particular order of calls: first the connection to the node manager should be called, then updateUI()
Definition at line 158 of file LayerBox.cpp.
References KisAction::ACTIVE_IMAGE, KisLayerFilterWidget::filteringOptionsChanged(), KisLayerFilterWidget::getActiveColors(), KisLayerFilterWidget::hasTextFilter(), indentationSlider, infoTextCombobox, infoTextInlineChkbox, infoTextOpacitySlider, KisLayerFilterWidget::isCurrentlyFiltering(), layerFilterWidget, KisConfig::layerInfoTextOpacity(), KisConfig::layerInfoTextStyle(), layerSelectionCheckBox, KisConfig::layerThumbnailSize(), KisConfig::layerTreeIndentation(), KisIconUtils::loadIcon(), m_colorLabelCompressor, m_colorSelector, m_colorSelectorAction, m_filteringModel, m_infoTextOpacityCompressor, m_newLayerMenu, m_nodeModel, m_nodeOpacityCompressor, m_opLayerMenu, m_showGlobalSelectionMask, m_thumbnailSizeCompressor, m_treeIndentationCompressor, m_wdgLayerBox, palette, selectionChanged(), KisAction::setActivationFlags(), KisSliderSpinBox::setPageStep(), KisSliderSpinBox::setRange(), KisSpinBoxI18nHelper::setText(), KisSliderSpinBox::setValue(), KisConfig::showGlobalSelection(), KisNodeFilterProxyModel::sigBeforeBeginRemoveRows(), KisConfig::sliderLabels(), slotAdjustCurrentBeforeRemoveRows(), slotCollapsed(), slotColorLabelChanged(), slotCompositeOpChanged(), slotContextMenuRequested(), slotEditGlobalSelection(), slotExpanded(), slotForgetAboutSavedNodeBeforeEditSelectionMode(), slotModelReset(), slotNodeCollapsedChanged(), slotOpacityChanged(), slotOpacitySliderMoved(), slotUpdateIcons(), slotUpdateLayerInfoTextOpacity(), slotUpdateLayerInfoTextStyle(), slotUpdateThumbnailIconSize(), slotUpdateTreeIndentation(), slotUpdateUseInlineLayerInfoText(), slotUpdateUseLayerSelectionCheckbox(), thumbnailSizeSlider, updateAvailableLabels(), updateLayerFiltering(), updateUI(), KisConfig::useInlineLayerInfoText(), and KisConfig::useLayerSelectionCheckbox().
|
override |
Definition at line 439 of file LayerBox.cpp.
References m_wdgLayerBox.
|
inlineprivate |
|
inlineprivate |
Definition at line 128 of file LayerBox.cpp.
References KisActionManager::actionByName(), KisViewManager::actionManager(), button(), KisViewManager::mainWindowAsQWidget(), and slotUpdateIcons().
|
private |
Scales opacity from the range 0...100 to the integer range 0...255
Definition at line 148 of file LayerBox.cpp.
Definition at line 923 of file LayerBox.cpp.
References KisNodeManager::isNodeHidden(), KIS_ASSERT_RECOVER_NOOP, KisNode::lastChild(), m_image, KisNode::nextSibling(), KisNode::parent, KisNode::prevSibling(), and KisNodeFacade::root.
|
overrideprotected |
Definition at line 659 of file LayerBox.cpp.
References m_nodeModel.
|
signal |
|
privateslot |
|
inlineoverridevirtual |
Reimplemented from KoCanvasObserverBase.
Definition at line 72 of file LayerBox.h.
|
privateslot |
When the user clears the extended selection by clicking on the empty area of the docker, the selection should be reset on to the active layer, which might be even unselected(!).
Definition at line 1040 of file LayerBox.cpp.
References m_filteringModel, m_nodeManager, m_wdgLayerBox, and updateUI().
|
overridevirtual |
re-implement this method in your canvas observer. It will be called whenever a canvas becomes active. Note that you are responsible for not connecting more than one time to the signals of a canvas or any of the QObjects you can access through the canvas.
Implements KoCanvasObserverBase.
Definition at line 539 of file LayerBox.cpp.
References addActionToMenu(), KisImage::animationInterface(), expandNodesRecursively(), imageChanged(), m_canvas, m_filteringModel, m_image, m_newLayerMenu, m_nodeManager, m_nodeModel, m_selectionActionsAdapter, m_wdgLayerBox, notifyImageDeleted(), KisImage::rootLayer(), setCurrentNode(), KisDocument::shapeController, KisImageAnimationInterface::sigUiTimeChanged(), slotImageTimeChanged(), slotNodeCollapsedChanged(), slotNodeManagerChangedSelection(), and updateAvailableLabels().
This method is called only when non-GUI code requested the change of the current node
setCanvas() calls to node managed and layer box are coming out-of-sync, so it might happen that setCurrentNode() call will arrive with a node from a different image. We should check that and ignore such calls.
TODO: make bootstrapping of layers-related structures a bit more straight-forward. We need to have a single source of truth for the "active layer", and all the initialization should happen in one direction without cycles.
Definition at line 740 of file LayerBox.cpp.
References KisNodeModel::ActiveRole, KisWeakSharedPtr< T >::data(), KisNode::graphListener, m_filteringModel, m_image, and updateUI().
|
overridevirtual |
reimplemented from KisMainwindowObserver
Implements KisMainwindowObserver.
Definition at line 482 of file LayerBox.cpp.
References KisViewManager::actionManager(), connectActionToButton(), KisActionManager::createAction(), m_changeCloneSourceAction, m_layerToggleSolo, m_nodeManager, m_opLayerMenu, m_propertiesAction, m_removeAction, m_showGlobalSelectionMask, m_wdgLayerBox, KisViewManager::nodeManager(), slotAddLayerBnClicked(), slotChangeCloneSourceClicked(), slotForgetAboutSavedNodeBeforeEditSelectionMode(), slotLayerOpMenuClosed(), slotLayerOpMenuOpened(), slotLowerClicked(), slotPropertiesClicked(), slotRaiseClicked(), slotRenameCurrentNode(), slotRmClicked(), and toggleActiveLayerSolo().
|
overrideprotected |
Definition at line 650 of file LayerBox.cpp.
References m_canvas, and m_nodeModel.
|
privateslot |
Definition at line 467 of file LayerBox.cpp.
References m_canvas, and m_nodeManager.
|
privateslot |
Qt has changed its behavior when deleting an item. Previously the selection priority was on the next item in the list, and now it has changed to the previous item. Here we just adjust the selected item after the node removal.
This method is called right before the Qt's beginRemoveRows() is called, that is we make sure that Qt will never have to adjust the position of the removed cursor.
See bug: https://bugs.kde.org/show_bug.cgi?id=345601
Definition at line 1072 of file LayerBox.cpp.
References m_filteringModel, and m_wdgLayerBox.
|
privateslot |
Definition at line 858 of file LayerBox.cpp.
References m_canvas, and m_nodeManager.
|
privateslot |
Definition at line 886 of file LayerBox.cpp.
References m_filteringModel, and KisBaseNode::setCollapsed().
|
privateslot |
Definition at line 1135 of file LayerBox.cpp.
References KisNode::childNodes(), m_nodeManager, KisLayerUtils::recursiveApplyNodes(), and KisBaseNode::setColorLabelIndex().
|
privateslot |
Definition at line 864 of file LayerBox.cpp.
References m_canvas, m_nodeManager, and m_wdgLayerBox.
|
privateslot |
Definition at line 807 of file LayerBox.cpp.
References m_canvas, m_nodeManager, and updateLayerOpMenu().
|
privateslot |
Definition at line 956 of file LayerBox.cpp.
References KisProcessingApplicator::applyCommand(), KisNode::childNodes(), KisProcessingApplicator::end(), KisStrokeJobData::EXCLUSIVE, findNonHidableNode(), kundo2_i18n(), m_image, m_nodeManager, m_nodeModel, m_savedNodeBeforeEditSelectionMode, KisProcessingApplicator::NONE, KisImage::rootLayer(), KisSelection::selectedRect(), KisMask::selection, KisLayer::selectionMask(), KisStrokeJobData::SEQUENTIAL, setCurrentNode(), and KoProperties::setProperty().
|
privateslot |
Definition at line 894 of file LayerBox.cpp.
References m_filteringModel, and KisBaseNode::setCollapsed().
|
privateslot |
Definition at line 1293 of file LayerBox.cpp.
References m_savedNodeBeforeEditSelectionMode.
|
privateslot |
Definition at line 1171 of file LayerBox.cpp.
References updateUI().
|
privateslot |
Definition at line 852 of file LayerBox.cpp.
References m_canvas, and m_opLayerMenu.
|
privateslot |
Definition at line 846 of file LayerBox.cpp.
References m_canvas, m_opLayerMenu, m_wdgLayerBox, and updateLayerOpMenu().
|
privateslot |
Definition at line 832 of file LayerBox.cpp.
References m_canvas, and m_nodeManager.
|
privateslot |
Definition at line 763 of file LayerBox.cpp.
References m_filteringModel, m_nodeManager, m_nodeModel, m_wdgLayerBox, and updateUI().
|
privateslot |
Definition at line 911 of file LayerBox.cpp.
References expandNodesRecursively(), m_filteringModel, m_image, m_nodeModel, m_wdgLayerBox, and KisImage::rootLayer().
Definition at line 1107 of file LayerBox.cpp.
References KritaUtils::compareListsUnordered(), m_filteringModel, m_nodeManager, and m_wdgLayerBox.
|
privateslot |
Definition at line 873 of file LayerBox.cpp.
References convertOpacityToInt(), m_canvas, m_changedOpacityNode, m_newOpacity, and m_nodeManager.
|
privateslot |
Definition at line 879 of file LayerBox.cpp.
References m_activeNode, m_changedOpacityNode, m_newOpacity, m_nodeOpacityCompressor, and KisSignalCompressor::start().
|
privateslot |
Definition at line 838 of file LayerBox.cpp.
References m_canvas, and m_nodeManager.
|
privateslot |
Definition at line 826 of file LayerBox.cpp.
References m_canvas, and m_nodeManager.
|
privateslot |
Definition at line 1130 of file LayerBox.cpp.
References m_wdgLayerBox.
|
privateslot |
Definition at line 820 of file LayerBox.cpp.
References m_canvas, and m_nodeManager.
|
privateslot |
Definition at line 902 of file LayerBox.cpp.
References m_canvas.
|
privateslot |
Definition at line 781 of file LayerBox.cpp.
References KoCompositeOpRegistry::getKoID(), KoCompositeOp::id, KoCompositeOpRegistry::instance(), and m_wdgLayerBox.
|
privateslot |
Definition at line 791 of file LayerBox.cpp.
References m_wdgLayerBox.
|
privateslot |
Definition at line 1298 of file LayerBox.cpp.
References KisIconUtils::loadIcon(), and m_wdgLayerBox.
|
privateslot |
Definition at line 1365 of file LayerBox.cpp.
References infoTextOpacitySlider, KisConfig::layerInfoTextOpacity(), m_wdgLayerBox, and KisConfig::setLayerInfoTextOpacity().
|
privateslot |
Definition at line 1346 of file LayerBox.cpp.
References infoTextCombobox, infoTextInlineChkbox, infoTextOpacitySlider, KisConfig::layerInfoTextStyle(), m_wdgLayerBox, and KisConfig::setLayerInfoTextStyle().
|
privateslot |
Definition at line 799 of file LayerBox.cpp.
References m_wdgLayerBox, and value().
|
privateslot |
Definition at line 1327 of file LayerBox.cpp.
References m_nodeModel, m_wdgLayerBox, KisConfig::setLayerThumbnailSize(), and thumbnailSizeSlider.
|
privateslot |
Definition at line 1336 of file LayerBox.cpp.
References indentationSlider, KisConfig::layerTreeIndentation(), m_wdgLayerBox, and KisConfig::setLayerTreeIndentation().
|
privateslot |
Definition at line 1376 of file LayerBox.cpp.
References infoTextInlineChkbox, m_wdgLayerBox, KisConfig::setUseInlineLayerInfoText(), and KisConfig::useInlineLayerInfoText().
|
privateslot |
Definition at line 1388 of file LayerBox.cpp.
References layerSelectionCheckBox, m_wdgLayerBox, KisConfig::setUseLayerSelectionCheckbox(), and KisConfig::useLayerSelectionCheckbox().
|
privateslot |
Definition at line 1311 of file LayerBox.cpp.
References m_filteringModel, m_nodeManager, m_wdgLayerBox, and NodeView::toggleSolo().
|
overridevirtual |
Re-implement to notify the observer that its canvas is no longer among the living. The daisies, it is pushing up. This means you don't have to disconnect, it's dead.
The old canvas should be deleted already, so if you stored a pointer to it, don't touch!
Note that currently there is a bug where in certain specific circumstances unsetCanvas can be called when it shouldn't, see for example KWStatisticsDocker for a workaround for this problem.
Implements KoCanvasObserverBase.
Definition at line 634 of file LayerBox.cpp.
References m_canvas, m_filteringModel, m_image, m_newLayerMenu, m_nodeManager, and m_nodeModel.
|
privateslot |
Definition at line 1159 of file LayerBox.cpp.
References layerFilterWidget, m_image, KisNodeFacade::root, and KisLayerFilterWidget::updateColorLabels().
|
privateslot |
Definition at line 1165 of file LayerBox.cpp.
References KisLayerFilterWidget::getActiveColors(), KisLayerFilterWidget::getTextFilter(), layerFilterWidget, and m_filteringModel.
|
privateslot |
Definition at line 1177 of file LayerBox.cpp.
References addActionToMenu(), KisBaseNode::colorLabelIndex(), KisSharedPtr< T >::data(), KisClipboard::instance(), KisLayer::layerStyle, m_changeCloneSourceAction, m_colorSelector, m_colorSelectorAction, m_filteringModel, m_nodeManager, m_propertiesAction, and m_removeAction.
|
privateslot |
the composite op works in the color space of the parent layer, not the active one.
Definition at line 670 of file LayerBox.cpp.
References KisSignalAutoConnectionsStore::addConnection(), KisSignalAutoConnectionsStore::clear(), KoCompositeOp::colorSpace, KisBaseNode::compositeOp, KisSharedPtr< T >::data(), KisBaseNode::isEditable(), m_activeNode, m_activeNodeConnections, m_canvas, m_image, m_nodeManager, m_wdgLayerBox, KisNode::nextSibling(), KisBaseNode::opacity(), KisBaseNode::original(), KisNode::parent, KisGroupLayer::passThroughMode, KisNode::prevSibling(), KisNodeFacade::root, slotSetCompositeOp(), slotSetOpacity(), slotUpdateOpacitySlider(), and updateUI().
|
private |
Definition at line 180 of file LayerBox.h.
|
private |
Definition at line 181 of file LayerBox.h.
|
private |
Definition at line 183 of file LayerBox.h.
|
private |
Definition at line 182 of file LayerBox.h.
|
private |
Definition at line 178 of file LayerBox.h.
|
private |
Definition at line 184 of file LayerBox.h.
|
private |
Definition at line 186 of file LayerBox.h.
|
private |
Definition at line 188 of file LayerBox.h.
|
private |
Definition at line 153 of file LayerBox.h.
|
private |
Definition at line 169 of file LayerBox.h.
|
private |
Definition at line 165 of file LayerBox.h.
|
private |
Definition at line 172 of file LayerBox.h.
|
private |
Definition at line 161 of file LayerBox.h.
|
private |
Definition at line 162 of file LayerBox.h.
|
private |
Definition at line 159 of file LayerBox.h.
|
private |
Definition at line 157 of file LayerBox.h.
|
private |
Definition at line 175 of file LayerBox.h.
|
private |
Definition at line 170 of file LayerBox.h.
|
private |
Definition at line 155 of file LayerBox.h.
|
private |
Definition at line 164 of file LayerBox.h.
|
private |
Definition at line 160 of file LayerBox.h.
|
private |
Definition at line 158 of file LayerBox.h.
|
private |
Definition at line 176 of file LayerBox.h.
|
private |
Definition at line 156 of file LayerBox.h.
|
private |
Definition at line 168 of file LayerBox.h.
|
private |
Definition at line 167 of file LayerBox.h.
|
private |
Definition at line 187 of file LayerBox.h.
|
private |
Definition at line 154 of file LayerBox.h.
|
private |
Definition at line 171 of file LayerBox.h.
|
private |
Definition at line 173 of file LayerBox.h.
|
private |
Definition at line 174 of file LayerBox.h.
|
private |
Definition at line 163 of file LayerBox.h.
|
private |
Definition at line 179 of file LayerBox.h.