Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Save and load the collapse state of layer groups to PSD files
Igor Wectfa7e98c931d6
diff --git a/libs/psd/psd_layer_section.cpp b/libs/psd/psd_layer_section.cppindex 4c776ce4e1..472adce4d6 100644--- a/libs/psd/psd_layer_section.cpp+++ b/libs/psd/psd_layer_section.cpp@@ -507,7 +507,11 @@ void flattenNodes(KisNodeSP node, QList<FlattenedNode> &nodes){FlattenedNode item;item.node = child;- item.type = FlattenedNode::FOLDER_OPEN;+ if (child->collapsed()) {+ item.type = FlattenedNode::FOLDER_CLOSED;+ } else {+ item.type = FlattenedNode::FOLDER_OPEN;+ }nodes << item;}} else if (shapeLayer) {diff --git a/plugins/impex/psd/psd_loader.cpp b/plugins/impex/psd/psd_loader.cppindex 87e365c8dd..788486d6ad 100644--- a/plugins/impex/psd/psd_loader.cpp+++ b/plugins/impex/psd/psd_loader.cpp@@ -302,6 +302,10 @@ KisImportExportErrorCode PSDLoader::decode(QIODevice &io)groupLayer->setName(layerRecord->layerName);groupLayer->setVisible(layerRecord->visible);+ if (layerRecord->infoBlocks.sectionDividerType == psd_closed_folder) {+ groupLayer->setCollapsed(true);+ }+QString compositeOp = psd_blendmode_to_composite_op(layerRecord->infoBlocks.sectionDividerBlendMode);// Krita doesn't support pass-through blend