Krita Source Code Documentation
Loading...
Searching...
No Matches
KisLayerCollapseCommand.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2024 Dmitry Kazakov <dimula73@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
8
9#include <kis_node.h>
10
11
13 : KUndo2Command(newValue ? kundo2_i18n("Collapse node %1", node->name()) : kundo2_i18n("Expand node %1", node->name()), parent)
14 , m_node(node)
15 , m_oldValue(oldValue)
16 , m_newValue(newValue)
17{
18}
19
21 : KisLayerCollapseCommand(node, node->collapsed(), newValue, parent)
22{
23}
24
29
34
36{
37 const KisLayerCollapseCommand *cmd = dynamic_cast<const KisLayerCollapseCommand*>(other);
38
39 if (cmd && cmd->m_node == m_node) {
40 // verify the commands are actually chained
42
44 return true;
45 }
46
47 return false;
48}
bool mergeWith(const KUndo2Command *other) override
KisLayerCollapseCommand(KisNodeSP node, bool oldValue, bool newValue, KUndo2Command *parent=nullptr)
#define KIS_SAFE_ASSERT_RECOVER_RETURN_VALUE(cond, val)
Definition kis_assert.h:129
KUndo2MagicString kundo2_i18n(const char *text)
void setCollapsed(bool collapsed)