Commit b063f996 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

sketch: Add a clear and clone method to LayerModel

parent 1640a45b
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
#include <kis_filter_mask.h> #include <kis_filter_mask.h>
#include <kis_shape_controller.h> #include <kis_shape_controller.h>
#include <kis_adjustment_layer.h> #include <kis_adjustment_layer.h>
#include <kis_selection_manager.h>
#include <filter/kis_filter.h> #include <filter/kis_filter.h>
#include <filter/kis_filter_configuration.h> #include <filter/kis_filter_configuration.h>
#include <filter/kis_filter_registry.h> #include <filter/kis_filter_registry.h>
...@@ -535,6 +536,16 @@ void LayerModel::moveRight() ...@@ -535,6 +536,16 @@ void LayerModel::moveRight()
} }
} }
void LayerModel::clear()
{
d->canvas->view()->selectionManager()->clear();
}
void LayerModel::clone()
{
d->nodeManager->duplicateActiveNode();
}
void LayerModel::setLocked(int index, bool newLocked) void LayerModel::setLocked(int index, bool newLocked)
{ {
if (index > -1 && index < d->layers.count()) { if (index > -1 && index < d->layers.count()) {
......
...@@ -92,6 +92,8 @@ public: ...@@ -92,6 +92,8 @@ public:
Q_INVOKABLE void setVisible(int index, bool newVisible); Q_INVOKABLE void setVisible(int index, bool newVisible);
Q_INVOKABLE void setLocked(int index, bool newLocked); Q_INVOKABLE void setLocked(int index, bool newLocked);
QImage layerThumbnail(QString layerID) const; QImage layerThumbnail(QString layerID) const;
Q_INVOKABLE void clear();
Q_INVOKABLE void clone();
Q_INVOKABLE void deleteCurrentLayer(); Q_INVOKABLE void deleteCurrentLayer();
Q_INVOKABLE void deleteLayer(int index); Q_INVOKABLE void deleteLayer(int index);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment