Skip to content

armgit / krita

Public Imported from GitHub
0

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++

Remove KoShapeShadow

Dmitry Kazakov18003a8d2ff6
diff --git a/libs/flake/CMakeLists.txt b/libs/flake/CMakeLists.txt
index c02cda8119..b3eb11351c 100644
--- a/libs/flake/CMakeLists.txt
+++ b/libs/flake/CMakeLists.txt
@@ -102,7 +102,6 @@ set(kritaflake_SRCS
KoSnapProxy.cpp
KoSnapStrategy.cpp
KoSnapData.cpp
- KoShapeShadow.cpp
KoSharedLoadingData.cpp
KoSharedSavingData.cpp
KoViewConverter.cpp
@@ -155,7 +154,6 @@ set(kritaflake_SRCS
commands/KoParameterToPathCommand.cpp
commands/KoShapeTransformCommand.cpp
commands/KoPathFillRuleCommand.cpp
- commands/KoShapeShadowCommand.cpp
commands/KoPathReverseCommand.cpp
commands/KoShapeRenameCommand.cpp
commands/KoShapeRunAroundCommand.cpp
diff --git a/libs/flake/KoPathShape.cpp b/libs/flake/KoPathShape.cpp
index 1585f39a3d..90bd9ea13a 100644
--- a/libs/flake/KoPathShape.cpp
+++ b/libs/flake/KoPathShape.cpp
@@ -16,7 +16,6 @@
#include "KoPathShapeLoader.h"
#include "KoShapeSavingContext.h"
#include "KoShapeLoadingContext.h"
-#include "KoShapeShadow.h"
#include "KoShapeBackground.h"
#include "KoShapeContainer.h"
#include "KoFilterEffectStack.h"
@@ -294,11 +293,6 @@ QRectF KoPathShape::boundingRect() const
// add 10% extra update area around the doubled insets
QRectF bb = transform.mapRect(kisGrowRect(outline().boundingRect(), 1.1 * 0.5 * outlineSweepWidth));
- if (shadow()) {
- KoInsets insets;
- shadow()->insets(insets);
- bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
- }
if (filterEffectStack()) {
QRectF clipRect = filterEffectStack()->clipRectForBoundingRect(QRectF(QPointF(), size()));
bb |= transform.mapRect(clipRect);
@@ -1295,15 +1289,7 @@ bool KoPathShape::hitTest(const QPointF &position) const
return true;
}
- // if there is no shadow we can as well just leave
- if (! shadow())
- return false;
-
- // the shadow has an offset to the shape, so we simply
- // check if the position minus the shadow offset hits the shape
- point = absoluteTransformation().inverted().map(position - shadow()->offset());
-
- return outlinePath.contains(point);
+ return false;
}
void KoPathShape::setMarker(KoMarker *marker, KoFlake::MarkerPosition pos)
diff --git a/libs/flake/KoShape.cpp b/libs/flake/KoShape.cpp
index feafc83cd2..7cf5018e94 100644
--- a/libs/flake/KoShape.cpp
+++ b/libs/flake/KoShape.cpp
@@ -30,7 +30,6 @@
#include "KoShapeLoadingContext.h"
#include "KoViewConverter.h"
#include "KoShapeStroke.h"
-#include "KoShapeShadow.h"
#include "KoClipPath.h"
#include "KoPathShape.h"
#include "KoFilterEffectStack.h"
@@ -56,7 +55,6 @@
KoShape::SharedData::SharedData()
: QSharedData()
, size(50, 50)
- , shadow(0)
, filterEffectStack(0)
, transparency(0.0)
, zIndex(0)
@@ -89,7 +87,6 @@ KoShape::SharedData::SharedData(const SharedData &rhs)
, fill(rhs.fill)
, inheritBackground(rhs.inheritBackground)
, inheritStroke(rhs.inheritStroke)
- , shadow(0) // WARNING: not implemented in Krita
, clipPath(rhs.clipPath ? rhs.clipPath->clone() : 0)
, clipMask(rhs.clipMask ? rhs.clipMask->clone() : 0)
, additionalAttributes(rhs.additionalAttributes)
@@ -122,8 +119,6 @@ KoShape::SharedData::SharedData(const SharedData &rhs)
KoShape::SharedData::~SharedData()
{
- if (shadow && !shadow->deref())
- delete shadow;
if (filterEffectStack && !filterEffectStack->deref())
delete filterEffectStack;
}
@@ -320,20 +315,11 @@ bool KoShape::hitTest(const QPointF &position) const
if (bb.contains(point))
return true;
- // if there is no shadow we can as well just leave
- if (! s->shadow)
- return false;
-
- // the shadow has an offset to the shape, so we simply
- // check if the position minus the shadow offset hits the shape
- point = absoluteTransformation().inverted().map(position - s->shadow->offset());
-
- return bb.contains(point);
+ return false;
}
QRectF KoShape::boundingRect() const
{
-
QTransform transform = absoluteTransformation();
QRectF bb = outlineRect();
if (s->stroke) {
@@ -342,11 +328,6 @@ QRectF KoShape::boundingRect() const
bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
}
bb = transform.mapRect(bb);
- if (s->shadow) {
- KoInsets insets;
- s->shadow->insets(insets);
- bb.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
- }
if (s->filterEffectStack) {
QRectF clipRect = s->filterEffectStack->clipRectForBoundingRect(outlineRect());
bb |= transform.mapRect(clipRect);
@@ -646,15 +627,6 @@ QRectF KoShape::outlineRect() const
qMax(s.height(), qreal(0.0001))));
}
-QPainterPath KoShape::shadowOutline() const
-{
- if (background()) {
- return outline();
- }
-
- return QPainterPath();
-}
-
QPointF KoShape::absolutePosition(KoFlake::AnchorPosition anchor) const
{
const QRectF rc = outlineRect();
@@ -1105,24 +1077,6 @@ bool KoShape::inheritStroke() const
return s->inheritStroke;
}
-void KoShape::setShadow(KoShapeShadow *shadow)
-{
- if (s->shadow)
- s->shadow->deref();
- s->shadow = shadow;
- if (s->shadow) {
- s->shadow->ref();
- // TODO update changed area
- }
- shapeChangedPriv(ShadowChanged);
- notifyChanged();
-}
-
-KoShapeShadow *KoShape::shadow() const
-{
- return s->shadow;
-}
-
void KoShape::setClipPath(KoClipPath *clipPath)
{
s->clipPath.reset(clipPath);
diff --git a/libs/flake/KoShape.h b/libs/flake/KoShape.h
index 4562d9a618..4cbb70e63f 100644
--- a/libs/flake/KoShape.h
+++ b/libs/flake/KoShape.h
@@ -34,7 +34,6 @@ class KoShapeUserData;
class KoViewConverter;
class KoShapeSavingContext;
class KoShapeLoadingContext;
-class KoShapeShadow;
class KoFilterEffectStack;
class KoSnapData;
class KoClipPath;
@@ -103,7 +102,6 @@ public:
Deleted, ///< the shape was deleted
StrokeChanged, ///< the shapes stroke has changed
BackgroundChanged, ///< the shapes background has changed
- ShadowChanged, ///< the shapes shadow has changed
BorderChanged, ///< the shapes border has changed
ParameterChanged, ///< the shapes parameter has changed (KoParameterShape only)
ContentChanged, ///< the content of the shape changed e.g. a new image inside a pixmap/text change inside a textshape
@@ -278,7 +276,7 @@ public:
/**
* @brief Get the bounding box of the shape
*
- * This includes the line width and the shadow of the shape
+ * This includes the line width of the shape
*
* @return the bounding box of the shape
*/
@@ -695,18 +693,6 @@ public:
*/
virtual QRectF outlineRect() const;
- /**
- * returns the outline of the shape in the form of a path for the use of painting a shadow.
- *
- * Normally this would be the same as outline() if there is a fill (background) set on the
- * shape and empty if not. However, a shape could reimplement this to return an outline
- * even if no fill is defined. A typical example of this would be the picture shape
- * which has a picture but almost never a background.
- *
- * @returns the outline of the shape in the form of a path.
- */
- virtual QPainterPath shadowOutline() const;
-
/**
* Returns the currently set stroke, or 0 if there is no stroke.
* @return the currently set stroke, or 0 if there is no stroke.
@@ -773,12 +759,6 @@ public:
*/
bool inheritPaintOrder() const;
- /// Sets the new shadow, removing the old one
- void setShadow(KoShapeShadow *shadow);
-
- /// Returns the currently set shadow or 0 if there is no shadow set
- KoShapeShadow *shadow() const;
-
/// Sets a new clip path, removing the old one
void setClipPath(KoClipPath *clipPath);
diff --git a/libs/flake/KoShapeGroup.cpp b/libs/flake/KoShapeGroup.cpp
index 3025fe6194..9601317840 100644
--- a/libs/flake/KoShapeGroup.cpp
+++ b/libs/flake/KoShapeGroup.cpp
@@ -15,7 +15,6 @@
#include "KoXmlWriter.h"
#include "KoShapeRegistry.h"
#include "KoShapeStrokeModel.h"
-#include "KoShapeShadow.h"
#include "KoInsets.h"
#include <FlakeDebug.h>
@@ -168,14 +167,7 @@ QRectF KoShapeGroup::outlineRect() const
QRectF KoShapeGroup::boundingRect() const
{
- QRectF groupBound = KoShape::boundingRect(shapes());
-
- if (shadow()) {
- KoInsets insets;
- shadow()->insets(insets);
- groupBound.adjust(-insets.left, -insets.top, insets.right, insets.bottom);
- }
- return groupBound;
+ return KoShape::boundingRect(shapes());
}
void KoShapeGroup::shapeChanged(ChangeType type, KoShape *shape)
diff --git a/libs/flake/KoShapeManager.cpp b/libs/flake/KoShapeManager.cpp
index 188be15dd6..c432f9b23a 100644
--- a/libs/flake/KoShapeManager.cpp
+++ b/libs/flake/KoShapeManager.cpp
@@ -19,7 +19,6 @@
#include "KoShapeStrokeModel.h"
#include "KoShapeGroup.h"
#include "KoToolProxy.h"
-#include "KoShapeShadow.h"
#include "KoShapeLayer.h"
#include "KoFilterEffect.h"
#include "KoFilterEffectStack.h"
@@ -200,11 +199,6 @@ void renderShapes(typename KisForest<KoShape*>::child_iterator beginIt,
painter.setOpacity(1.0-transparency);
}
- if (shape->shadow()) {
- KisQPainterStateSaver saver(&painter);
- shape->shadow()->paint(shape, painter);
- }
-
QScopedPointer<KoClipMaskPainter> clipMaskPainter;
QPainter *shapePainter = &painter;
diff --git a/libs/flake/KoShapeShadow.cpp b/libs/flake/KoShapeShadow.cpp
deleted file mode 100644
index 04ae14fc79..0000000000
--- a/libs/flake/KoShapeShadow.cpp
+++ /dev/null
@@ -1,329 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2008-2009 Jan Hambrecht <[email protected]>
- * SPDX-FileCopyrightText: 2010 Thomas Zander <[email protected]>
- * SPDX-FileCopyrightText: 2010 Ariya Hidayat <[email protected]>
- * SPDX-FileCopyrightText: 2010-2011 Yue Liu <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoShapeShadow.h"
-#include "KoShapeGroup.h"
-#include "KoSelection.h"
-#include "KoShapeSavingContext.h"
-#include "KoShapeStrokeModel.h"
-#include "KoShape.h"
-#include "KoInsets.h"
-#include "KoPathShape.h"
-#include <FlakeDebug.h>
-#include <QPainter>
-#include <QPainterPath>
-#include <QAtomicInt>
-#include <QImage>
-#include <QRectF>
-
-class Q_DECL_HIDDEN KoShapeShadow::Private
-{
-public:
- Private()
- : offset(2, 2), color(Qt::black), blur(8), visible(true), refCount(0) {
- }
- QPointF offset;
- QColor color;
- qreal blur;
- bool visible;
- QAtomicInt refCount;
-
- /**
- * Paints the shadow of the shape group to the buffer image.
- * @param group the shape group to paint around
- * @param painter the painter to paint on the image
- * @param converter to convert between internal and view coordinates.
- */
- void paintGroupShadow(KoShapeGroup *group, QPainter &painter);
- /**
- * Paints the shadow of the shape to the buffer image.
- * @param shape the shape to paint around
- * @param painter the painter to paint on the image
- */
- void paintShadow(KoShape *shape, QPainter &painter);
- void blurShadow(QImage &image, int radius, const QColor& shadowColor);
-};
-
-void KoShapeShadow::Private::paintGroupShadow(KoShapeGroup *group, QPainter &painter)
-{
- QList<KoShape*> shapes = group->shapes();
- Q_FOREACH (KoShape *child, shapes) {
- // we paint recursively here, so we do not have to check recursively for visibility
- if (!child->isVisible(false))
- continue;
- painter.save();
- //apply group child's transformation
- painter.setTransform(child->absoluteTransformation(), true);
- paintShadow(child, painter);
- painter.restore();
- }
-}
-
-void KoShapeShadow::Private::paintShadow(KoShape *shape, QPainter &painter)
-{
- QPainterPath path(shape->shadowOutline());
- if (!path.isEmpty()) {
- painter.save();
- painter.setBrush(QBrush(color));
-
- // Make sure the shadow has the same fill rule as the shape.
- KoPathShape * pathShape = dynamic_cast<KoPathShape*>(shape);
- if (pathShape)
- path.setFillRule(pathShape->fillRule());
-
- painter.drawPath(path);
- painter.restore();
- }
-
- if (shape->stroke()) {
- shape->stroke()->paint(shape, painter);
- }
-}
-
-/* You can also find a BSD version to this method from
- * https://github.com/ariya/X2/tree/master/graphics/shadowblur
- */
-void KoShapeShadow::Private::blurShadow(QImage &image, int radius, const QColor& shadowColor)
-{
- static const int BlurSumShift = 15;
-
- // Check http://www.w3.org/TR/SVG/filters.html#
- // As noted in the SVG filter specification, ru
- // approximates a real gaussian blur nicely.
- // See comments in https://bugs.webkit.org/show_bug.cgi?id=40793, it seems sensible
- // to follow Skia's limit of 128 pixels for the blur radius.
- if (radius > 128)
- radius = 128;
-
- int channels[4] = { 3, 0, 1, 3 };
- int dmax = radius >> 1;
- int dmin = dmax - 1 + (radius & 1);
- if (dmin < 0)
- dmin = 0;
-
- // Two stages: horizontal and vertical
- for (int k = 0; k < 2; ++k) {
-
- unsigned char* pixels = image.bits();
- int stride = (k == 0) ? 4 : image.bytesPerLine();
- int delta = (k == 0) ? image.bytesPerLine() : 4;
- int jfinal = (k == 0) ? image.height() : image.width();
- int dim = (k == 0) ? image.width() : image.height();
-
- for (int j = 0; j < jfinal; ++j, pixels += delta) {
-
- // For each step, we blur the alpha in a channel and store the result
- // in another channel for the subsequent step.
- // We use sliding window algorithm to accumulate the alpha values.
- // This is much more efficient than computing the sum of each pixels
- // covered by the box kernel size for each x.
-
- for (int step = 0; step < 3; ++step) {
- int side1 = (step == 0) ? dmin : dmax;
- int side2 = (step == 1) ? dmin : dmax;
- int pixelCount = side1 + 1 + side2;
- int invCount = ((1 << BlurSumShift) + pixelCount - 1) / pixelCount;
- int ofs = 1 + side2;
- int alpha1 = pixels[channels[step]];
- int alpha2 = pixels[(dim - 1) * stride + channels[step]];
- unsigned char* ptr = pixels + channels[step + 1];
- unsigned char* prev = pixels + stride + channels[step];
- unsigned char* next = pixels + ofs * stride + channels[step];
-
- int i;
- int sum = side1 * alpha1 + alpha1;
- int limit = (dim < side2 + 1) ? dim : side2 + 1;
- for (i = 1; i < limit; ++i, prev += stride)
- sum += *prev;
- if (limit <= side2)
- sum += (side2 - limit + 1) * alpha2;
-
- limit = (side1 < dim) ? side1 : dim;
- for (i = 0; i < limit; ptr += stride, next += stride, ++i, ++ofs) {
- *ptr = (sum * invCount) >> BlurSumShift;
- sum += ((ofs < dim) ? *next : alpha2) - alpha1;
- }
- prev = pixels + channels[step];
- for (; ofs < dim; ptr += stride, prev += stride, next += stride, ++i, ++ofs) {
- *ptr = (sum * invCount) >> BlurSumShift;
- sum += (*next) - (*prev);
- }
- for (; i < dim; ptr += stride, prev += stride, ++i) {
- *ptr = (sum * invCount) >> BlurSumShift;
- sum += alpha2 - (*prev);
- }
- }
- }
- }
-
- // "Colorize" with the right shadow color.
- QPainter p(&image);
- p.setCompositionMode(QPainter::CompositionMode_SourceIn);
- p.fillRect(image.rect(), shadowColor);
- p.end();
-}
-
-
-// ----------------------------------------------------------------
-// KoShapeShadow
-
-
-KoShapeShadow::KoShapeShadow()
- : d(new Private())
-{
-}
-
-KoShapeShadow::~KoShapeShadow()
-{
- delete d;
-}
-
-KoShapeShadow::KoShapeShadow(const KoShapeShadow &rhs)
- : d(new Private(*rhs.d))
-{
- d->refCount = 0;
-}
-
-KoShapeShadow& KoShapeShadow::operator=(const KoShapeShadow &rhs)
-{
- *d = *rhs.d;
- d->refCount = 0;
- return *this;
-}
-
-void KoShapeShadow::paint(KoShape *shape, QPainter &painter)
-{
- if (! d->visible)
- return;
-
- // So the approach we are taking here is to draw into a buffer image the size of boundingRect
- // We offset by the shadow offset at the time we draw into the buffer
- // Then we filter the image and draw it at the position of the bounding rect on canvas
-
- QTransform documentToView = painter.transform();
-
- //the boundingRect of the shape or the KoSelection boundingRect of the group
- QRectF shadowRect = shape->boundingRect();
- QRectF zoomedClipRegion = documentToView.mapRect(shadowRect);
-
- // Init the buffer image
- QImage sourceGraphic(zoomedClipRegion.size().toSize(), QImage::Format_ARGB32_Premultiplied);
- sourceGraphic.fill(qRgba(0,0,0,0));
- // Init the buffer painter
- QPainter imagePainter(&sourceGraphic);
- imagePainter.setPen(Qt::NoPen);
- imagePainter.setBrush(Qt::NoBrush);
- imagePainter.setRenderHint(QPainter::Antialiasing, painter.testRenderHint(QPainter::Antialiasing));
- // Since our image buffer and the canvas don't align we need to offset our drawings
- imagePainter.translate(-1.0f*documentToView.map(shadowRect.topLeft()));
-
- // Handle the shadow offset
- imagePainter.translate(documentToView.map(offset()));
-
- KoShapeGroup *group = dynamic_cast<KoShapeGroup*>(shape);
- if (group) {
- d->paintGroupShadow(group, imagePainter);
- } else {
- //apply shape's transformation
- imagePainter.setTransform(shape->absoluteTransformation(), true);
-
- d->paintShadow(shape, imagePainter);
- }
- imagePainter.end();
-
- // Blur the shadow (well the entire buffer)
- d->blurShadow(sourceGraphic, qRound(documentToView.m11() * d->blur), d->color);
-
- // Paint the result
- painter.save();
- // The painter is initialized for us with canvas transform 'plus' shape transform
- // we are only interested in the canvas transform so 'subtract' the shape transform part
- painter.setTransform(shape->absoluteTransformation().inverted() * painter.transform());
- painter.drawImage(zoomedClipRegion.topLeft(), sourceGraphic);
- painter.restore();
-}
-
-void KoShapeShadow::setOffset(const QPointF & offset)
-{
- d->offset = offset;
-}
-
-QPointF KoShapeShadow::offset() const
-{
- return d->offset;
-}
-
-void KoShapeShadow::setColor(const QColor &color)
-{
- d->color = color;
-}
-
-QColor KoShapeShadow::color() const
-{
- return d->color;
-}
-
-void KoShapeShadow::setBlur(qreal blur)
-{
- // force positive blur radius
- d->blur = qAbs(blur);
-}
-
-qreal KoShapeShadow::blur() const
-{
- return d->blur;
-}
-
-void KoShapeShadow::setVisible(bool visible)
-{
- d->visible = visible;
-}
-
-bool KoShapeShadow::isVisible() const
-{
- return d->visible;
-}
-
-void KoShapeShadow::insets(KoInsets &insets) const
-{
- if (!d->visible) {
- insets.top = 0;
- insets.bottom = 0;
- insets.left = 0;
- insets.right = 0;
- return;
- }
-
- qreal expand = d->blur;
-
- insets.left = (d->offset.x() < 0.0) ? qAbs(d->offset.x()) : 0.0;
- insets.top = (d->offset.y() < 0.0) ? qAbs(d->offset.y()) : 0.0;
- insets.right = (d->offset.x() > 0.0) ? d->offset.x() : 0.0;
- insets.bottom = (d->offset.y() > 0.0) ? d->offset.y() : 0.0;
-
- insets.left += expand;
- insets.top += expand;
- insets.right += expand;
- insets.bottom += expand;
-}
-
-bool KoShapeShadow::ref()
-{
- return d->refCount.ref();
-}
-
-bool KoShapeShadow::deref()
-{
- return d->refCount.deref();
-}
-
-int KoShapeShadow::useCount() const
-{
- return d->refCount;
-}
diff --git a/libs/flake/KoShapeShadow.h b/libs/flake/KoShapeShadow.h
deleted file mode 100644
index 2ec177a88c..0000000000
--- a/libs/flake/KoShapeShadow.h
+++ /dev/null
@@ -1,93 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
- * SPDX-FileCopyrightText: 2010 Thomas Zander <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#ifndef KOSHAPESHADOW_H
-#define KOSHAPESHADOW_H
-
-#include "kritaflake_export.h"
-
-#include <QtGlobal>
-
-class KoShape;
-class KoShapeSavingContext;
-class QPainter;
-class QPointF;
-class QColor;
-struct KoInsets;
-
-class KRITAFLAKE_EXPORT KoShapeShadow
-{
-public:
- KoShapeShadow();
- ~KoShapeShadow();
-
- KoShapeShadow(const KoShapeShadow &rhs);
- KoShapeShadow& operator=(const KoShapeShadow &rhs);
-
- /**
- * Paints the shadow of the shape.
- * @param shape the shape to paint around
- * @param painter the painter to paint shadows to canvas
- * @param converter to convert between internal and view coordinates.
- */
- void paint(KoShape *shape, QPainter &painter);
-
- /**
- * Sets the shadow offset from the topleft corner of the shape
- * @param offset the shadow offset
- */
- void setOffset(const QPointF &offset);
-
- /// Returns the shadow offset
- QPointF offset() const;
-
- /**
- * Sets the shadow color, including the shadow opacity.
- * @param color the shadow color and opacity
- */
- void setColor(const QColor &color);
-
- /// Returns the shadow color including opacity
- QColor color() const;
-
- /**
- * Sets the shadow blur radius of the shape
- * @param blur the shadow blur radius
- */
- void setBlur(qreal blur);
-
- /// Returns the shadow blur radius
- qreal blur() const;
-
- /// Sets the shadow visibility
- void setVisible(bool visible);
-
- /// Returns if shadow is visible
- bool isVisible() const;
-
- /// Fills the insets object with the space the shadow takes around a shape
- void insets(KoInsets &insets) const;
-
- /**
- * Increments the use-value.
- * Returns true if the new value is non-zero, false otherwise.
- */
- bool ref();
- /**
- * Decrements the use-value.
- * Returns true if the new value is non-zero, false otherwise.
- */
- bool deref();
- /// Return the usage count
- int useCount() const;
-
-private:
- class Private;
- Private * const d;
-};
-
-#endif // KOSHAPESHADOW_H
diff --git a/libs/flake/KoShape_p.h b/libs/flake/KoShape_p.h
index b69e64c16b..719f17c155 100644
--- a/libs/flake/KoShape_p.h
+++ b/libs/flake/KoShape_p.h
@@ -43,7 +43,6 @@ public:
QSharedPointer<KoShapeBackground> fill; ///< Stands for the background color / fill etc.
bool inheritBackground = false;
bool inheritStroke = false;
- KoShapeShadow * shadow; ///< the current shape shadow
// XXX: change this to instance instead of pointer
QScopedPointer<KoClipPath> clipPath; ///< the current clip path
QScopedPointer<KoClipMask> clipMask; ///< the current clip mask
diff --git a/libs/flake/commands/KoShapeShadowCommand.cpp b/libs/flake/commands/KoShapeShadowCommand.cpp
deleted file mode 100644
index 23f5f4c977..0000000000
--- a/libs/flake/commands/KoShapeShadowCommand.cpp
+++ /dev/null
@@ -1,129 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoShapeShadowCommand.h"
-#include "KoShape.h"
-#include "KoShapeShadow.h"
-#include <KoShapeBulkActionLock.h>
-
-#include <klocalizedstring.h>
-
-class Q_DECL_HIDDEN KoShapeShadowCommand::Private
-{
-public:
- Private() {}
- ~Private() {
- Q_FOREACH (KoShapeShadow* shadow, oldShadows) {
- if (shadow && !shadow->deref())
- delete shadow;
- }
- }
-
- void addOldShadow(KoShapeShadow * oldShadow)
- {
- if (oldShadow)
- oldShadow->ref();
- oldShadows.append(oldShadow);
- }
-
- void addNewShadow(KoShapeShadow * newShadow)
- {
- if (newShadow)
- newShadow->ref();
- newShadows.append(newShadow);
- }
-
- QList<KoShape*> shapes; ///< the shapes to set shadow for
- QList<KoShapeShadow*> oldShadows; ///< the old shadows, one for each shape
- QList<KoShapeShadow*> newShadows; ///< the new shadows to set
-};
-
-KoShapeShadowCommand::KoShapeShadowCommand(const QList<KoShape*> &shapes, KoShapeShadow *shadow, KUndo2Command *parent)
- : KUndo2Command(parent)
- , d(new Private())
-{
- d->shapes = shapes;
- // save old shadows
- Q_FOREACH (KoShape *shape, d->shapes) {
- d->addOldShadow(shape->shadow());
- d->addNewShadow(shadow);
- }
-
- setText(kundo2_i18n("Set Shadow"));
-}
-
-KoShapeShadowCommand::KoShapeShadowCommand(const QList<KoShape*> &shapes, const QList<KoShapeShadow*> &shadows, KUndo2Command *parent)
- : KUndo2Command(parent)
- , d(new Private())
-{
- Q_ASSERT(shapes.count() == shadows.count());
-
- d->shapes = shapes;
-
- // save old shadows
- Q_FOREACH (KoShape *shape, shapes)
- d->addOldShadow(shape->shadow());
- Q_FOREACH (KoShapeShadow * shadow, shadows)
- d->addNewShadow(shadow);
-
- setText(kundo2_i18n("Set Shadow"));
-}
-
-KoShapeShadowCommand::KoShapeShadowCommand(KoShape* shape, KoShapeShadow *shadow, KUndo2Command *parent)
- : KUndo2Command(parent)
- , d(new Private())
-{
- d->shapes.append(shape);
- d->addNewShadow(shadow);
- d->addOldShadow(shape->shadow());
-
- setText(kundo2_i18n("Set Shadow"));
-}
-
-KoShapeShadowCommand::~KoShapeShadowCommand()
-{
- delete d;
-}
-
-void KoShapeShadowCommand::redo()
-{
- KUndo2Command::redo();
-
- KoShapeBulkActionLock lock(d->shapes);
-
- int shapeCount = d->shapes.count();
- for (int i = 0; i < shapeCount; ++i) {
- KoShape *shape = d->shapes[i];
-
- // TODO: implement comparison operator for KoShapeShadow
- // (or just deprecate it entirely)
- if (shape->shadow() || d->newShadows[i]) {
- shape->setShadow(d->newShadows[i]);
- }
- }
-
- KoShapeBulkActionLock::bulkShapesUpdate(lock.unlock());
-}
-
-void KoShapeShadowCommand::undo()
-{
- KUndo2Command::undo();
-
- KoShapeBulkActionLock lock(d->shapes);
-
- int shapeCount = d->shapes.count();
- for (int i = 0; i < shapeCount; ++i) {
- KoShape *shape = d->shapes[i];
-
- // TODO: implement comparison operator for KoShapeShadow
- // (or just deprecate it entirely)
- if (shape->shadow() || d->oldShadows[i]) {
- shape->setShadow(d->oldShadows[i]);
- }
- }
-
- KoShapeBulkActionLock::bulkShapesUpdate(lock.unlock());
-}
diff --git a/libs/flake/commands/KoShapeShadowCommand.h b/libs/flake/commands/KoShapeShadowCommand.h
deleted file mode 100644
index 4a4b91b044..0000000000
--- a/libs/flake/commands/KoShapeShadowCommand.h
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#ifndef KOSHAPESHADOWCOMMAND_H
-#define KOSHAPESHADOWCOMMAND_H
-
-#include "kritaflake_export.h"
-#include <kundo2command.h>
-#include <QList>
-
-class KoShape;
-class KoShapeShadow;
-
-/// The undo / redo command for setting the shape shadow
-class KRITAFLAKE_EXPORT KoShapeShadowCommand : public KUndo2Command
-{
-public:
- /**
- * Command to set a new shape shadow.
- * @param shapes a set of all the shapes that should get the new shadow.
- * @param shadow the new shadow, the same for all given shapes
- * @param parent the parent command used for macro commands
- */
- KoShapeShadowCommand(const QList<KoShape*> & shapes, KoShapeShadow *shadow, KUndo2Command *parent = 0);
-
- /**
- * Command to set new shape shadows.
- * @param shapes a set of all the shapes that should get a new shadow.
- * @param shadows the new shadows, one for each shape
- * @param parent the parent command used for macro commands
- */
- KoShapeShadowCommand(const QList<KoShape*> &shapes, const QList<KoShapeShadow*> &shadows, KUndo2Command *parent = 0);
-
- /**
- * Command to set a new shape shadow.
- * @param shape a single shape that should get the new shadow.
- * @param shadow the new shadow
- * @param parent the parent command used for macro commands
- */
- KoShapeShadowCommand(KoShape *shape, KoShapeShadow *shadow, KUndo2Command *parent = 0);
-
- ~KoShapeShadowCommand() override;
- /// redo the command
- void redo() override;
- /// revert the actions done in redo
- void undo() override;
-private:
- class Private;
- Private * const d;
-};
-
-#endif // KOSHAPESHADOWCOMMAND_H
diff --git a/libs/flake/tests/CMakeLists.txt b/libs/flake/tests/CMakeLists.txt
index f34c3812f6..6801707a06 100644
--- a/libs/flake/tests/CMakeLists.txt
+++ b/libs/flake/tests/CMakeLists.txt
@@ -14,7 +14,6 @@ kis_add_tests(
TestResourceManager.cpp
TestShapeBackgroundCommand.cpp
TestShapeStrokeCommand.cpp
- TestShapeShadowCommand.cpp
TestInputDevice.cpp
TestSnapStrategy.cpp
TestPathShape.cpp
diff --git a/libs/flake/tests/TestShapeAt.cpp b/libs/flake/tests/TestShapeAt.cpp
index eb357c49dd..860690a310 100644
--- a/libs/flake/tests/TestShapeAt.cpp
+++ b/libs/flake/tests/TestShapeAt.cpp
@@ -9,7 +9,6 @@
#include <KoShapeManager.h>
#include <KoSelection.h>
#include <KoShapeStroke.h>
-#include <KoShapeShadow.h>
#include <KoInsets.h>
#include <simpletest.h>
@@ -105,14 +104,6 @@ void TestShapeAt::testShadow()
stroke->strokeInsets(&shape, strokeInsets);
bbox.adjust(-strokeInsets.left, -strokeInsets.top, strokeInsets.right, strokeInsets.bottom);
QCOMPARE(shape.boundingRect(), bbox);
-
- KoShapeShadow *shadow = new KoShapeShadow();
- shadow->setOffset(QPointF(5, 9));
- shape.setShadow(shadow);
- KoInsets shadowInsets;
- shadow->insets(shadowInsets);
- bbox.adjust(-shadowInsets.left, -shadowInsets.top, shadowInsets.right, shadowInsets.bottom);
- QCOMPARE(shape.boundingRect(), bbox);
}
SIMPLE_TEST_MAIN(TestShapeAt)
diff --git a/libs/flake/tests/TestShapeGroupCommand.cpp b/libs/flake/tests/TestShapeGroupCommand.cpp
index 81d7e204cc..4c0ee587b7 100644
--- a/libs/flake/tests/TestShapeGroupCommand.cpp
+++ b/libs/flake/tests/TestShapeGroupCommand.cpp
@@ -10,7 +10,6 @@
#include <KoShapeGroupCommand.h>
#include <KoShapeUngroupCommand.h>
#include <KoShapeStroke.h>
-#include <KoShapeShadow.h>
#include <kundo2command.h>
#include <KoShapeReorderCommand.h>
@@ -22,7 +21,7 @@
#include <simpletest.h>
TestShapeGroupCommand::TestShapeGroupCommand()
- : toplevelGroup(0), sublevelGroup(0), strokeGroup(0)
+ : toplevelGroup(0), sublevelGroup(0)
, cmd1(0), cmd2(0), strokeCmd(0)
, toplevelShape1(0), toplevelShape2(0), toplevelShape3(0), toplevelShape4(0)
, sublevelShape1(0), sublevelShape2(0)
@@ -69,10 +68,6 @@ void TestShapeGroupCommand::init()
strokeShape1 = createMockShape(QRectF(0, 0, 50, 50));
strokeShape2 = createMockShape(QRectF(25, 25, 50, 50));
-
- strokeGroup = new KoShapeGroup();
- strokeGroup->setStroke(toQShared(new KoShapeStroke(2.0f)));
- strokeGroup->setShadow(new KoShapeShadow());
}
void TestShapeGroupCommand::cleanup()
diff --git a/libs/flake/tests/TestShapeGroupCommand.h b/libs/flake/tests/TestShapeGroupCommand.h
index aecb205be2..d3608643a1 100644
--- a/libs/flake/tests/TestShapeGroupCommand.h
+++ b/libs/flake/tests/TestShapeGroupCommand.h
@@ -35,7 +35,7 @@ private Q_SLOTS:
void testUngrouping();
private:
- KoShapeGroup *toplevelGroup, *sublevelGroup, *strokeGroup;
+ KoShapeGroup *toplevelGroup, *sublevelGroup;
KUndo2Command *cmd1, *cmd2, *strokeCmd;
MockShape *toplevelShape1, *toplevelShape2, *toplevelShape3, *toplevelShape4;
MockShape *sublevelShape1, *sublevelShape2;
diff --git a/libs/flake/tests/TestShapeShadowCommand.cpp b/libs/flake/tests/TestShapeShadowCommand.cpp
deleted file mode 100644
index d389024cf6..0000000000
--- a/libs/flake/tests/TestShapeShadowCommand.cpp
+++ /dev/null
@@ -1,55 +0,0 @@
-/* This file is part of the KDE project
-* SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
-*
-* SPDX-License-Identifier: LGPL-2.0-or-later
-*/
-#include "TestShapeShadowCommand.h"
-
-#include <MockShapes.h>
-#include "KoShapeShadow.h"
-#include "KoShapeShadowCommand.h"
-#include "KoInsets.h"
-
-#include <simpletest.h>
-
-void TestShapeShadowCommand::refCounting()
-{
- MockShape * shape1 = new MockShape();
- KoShapeShadow * shadow1 = new KoShapeShadow();
- KoShapeShadow * shadow2 = new KoShapeShadow();
- KoShapeShadow * shadow3 = new KoShapeShadow();
-
- shape1->setShadow(shadow1);
- QVERIFY(shape1->shadow() == shadow1);
- QCOMPARE(shadow1->useCount(), 1);
-
- // old shadow1, new shadow2
- KUndo2Command *cmd1 = new KoShapeShadowCommand(shape1, shadow2);
- cmd1->redo();
- QVERIFY(shape1->shadow() == shadow2);
-
- // change back to shadow1
- cmd1->undo();
- QVERIFY(shape1->shadow() == shadow1);
-
- // old shadow1, new shadow3
- KUndo2Command *cmd2 = new KoShapeShadowCommand(shape1, shadow3);
- cmd2->redo();
- QVERIFY(shape1->shadow() == shadow3);
-
- // this command has the shadow1 as the old one
- delete cmd1;
-
- // set back to shadow1
- cmd2->undo();
- QVERIFY(shape1->shadow() == shadow1);
-
- // if shadow1 is deleted when deleting cmd1 this will crash
- KoInsets insets;
- shadow1->insets(insets);
-
- delete cmd2;
- delete shape1;
-}
-
-SIMPLE_TEST_MAIN(TestShapeShadowCommand)
diff --git a/libs/flake/tests/TestShapeShadowCommand.h b/libs/flake/tests/TestShapeShadowCommand.h
deleted file mode 100644
index 37c7980bfe..0000000000
--- a/libs/flake/tests/TestShapeShadowCommand.h
+++ /dev/null
@@ -1,18 +0,0 @@
-/* This file is part of the KDE project
-* SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
-*
-* SPDX-License-Identifier: LGPL-2.0-or-later
-*/
-#ifndef TESTSHAPESHADOWCOMMAND_H
-#define TESTSHAPESHADOWCOMMAND_H
-
-#include <QObject>
-
-class TestShapeShadowCommand : public QObject
-{
- Q_OBJECT
-private Q_SLOTS:
- void refCounting();
-};
-
-#endif // TESTSHAPESHADOWCOMMAND_H
diff --git a/libs/ui/flake/kis_shape_layer.cc b/libs/ui/flake/kis_shape_layer.cc
index 9762935dfe..2d7887205c 100644
--- a/libs/ui/flake/kis_shape_layer.cc
+++ b/libs/ui/flake/kis_shape_layer.cc
@@ -44,8 +44,6 @@
#include <KoSelection.h>
#include <KoShapeMoveCommand.h>
#include <KoShapeTransformCommand.h>
-#include <KoShapeShadow.h>
-#include <KoShapeShadowCommand.h>
#include "SvgWriter.h"
#include "SvgParser.h"
diff --git a/libs/widgets/CMakeLists.txt b/libs/widgets/CMakeLists.txt
index a6d12125c0..abe40c1b40 100644
--- a/libs/widgets/CMakeLists.txt
+++ b/libs/widgets/CMakeLists.txt
@@ -35,7 +35,6 @@ set(kritawidgets_LIB_SRCS
KoToolDocker.cpp
- KoShadowConfigWidget.cpp
KoMarkerSelector.cpp
KoMarkerModel.cpp
KoMarkerItemDelegate.cpp
@@ -88,7 +87,6 @@ set(kritawidgets_LIB_SRCS
ki18n_wrap_ui( kritawidgets_LIB_SRCS
KoConfigAuthorPage.ui
wdg_file_name_requester.ui
- KoShadowConfigWidget.ui
WdgDlgInternalColorSelector.ui
WdgPaletteListWidget.ui
)
diff --git a/libs/widgets/KoShadowConfigWidget.cpp b/libs/widgets/KoShadowConfigWidget.cpp
deleted file mode 100644
index 7d67fb4fa4..0000000000
--- a/libs/widgets/KoShadowConfigWidget.cpp
+++ /dev/null
@@ -1,228 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2012 C. Boemann <[email protected]>
- * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#include "KoShadowConfigWidget.h"
-#include "ui_KoShadowConfigWidget.h"
-
-#include <KoIcon.h>
-#include <KoUnit.h>
-#include <KoColorPopupAction.h>
-#include <KoCanvasBase.h>
-#include <KoCanvasResourceProvider.h>
-#include <KoSelection.h>
-#include <KoShapeShadow.h>
-#include <KoShapeShadowCommand.h>
-#include <KoSelectedShapesProxy.h>
-
-#include <klocalizedstring.h>
-
-#include <QCheckBox>
-
-#include <math.h>
-
-class Q_DECL_HIDDEN KoShadowConfigWidget::Private
-{
-public:
- Private()
- {
- }
- Ui_KoShadowConfigWidget widget;
- KoColorPopupAction *actionShadowColor {nullptr};
- KoCanvasBase *canvas {nullptr};
-};
-
-KoShadowConfigWidget::KoShadowConfigWidget(QWidget *parent)
- : QWidget(parent)
- , d(new Private())
-{
- d->widget.setupUi(this);
- d->widget.shadowOffset->setValue(8.0);
- d->widget.shadowBlur->setValue(8.0);
- d->widget.shadowBlur->setMinimum(0.0);
- d->widget.shadowAngle->setValue(315.0);
- d->widget.shadowAngle->setMinimum(0.0);
- d->widget.shadowAngle->setMaximum(360.0);
- d->widget.shadowVisible->setChecked(false);
- visibilityChanged();
-
- d->actionShadowColor = new KoColorPopupAction(this);
- d->actionShadowColor->setCurrentColor(QColor(0, 0, 0, 192)); // some reasonable default for shadow
- d->actionShadowColor->setIcon(koIcon("format-stroke-color"));
- d->actionShadowColor->setToolTip(i18n("Change the color of the shadow"));
- d->widget.shadowColor->setDefaultAction(d->actionShadowColor);
-
- connect(d->widget.shadowVisible, SIGNAL(toggled(bool)), this, SLOT(applyChanges()));
- connect(d->widget.shadowVisible, SIGNAL(toggled(bool)), this, SLOT(visibilityChanged()));
- connect(d->actionShadowColor, SIGNAL(colorChanged(KoColor)), this, SLOT(applyChanges()));
- connect(d->widget.shadowAngle, SIGNAL(valueChanged(int)), this, SLOT(applyChanges()));
- connect(d->widget.shadowOffset, SIGNAL(valueChangedPt(qreal)), this, SLOT(applyChanges()));
- connect(d->widget.shadowBlur, SIGNAL(valueChangedPt(qreal)), this, SLOT(applyChanges()));
-}
-
-KoShadowConfigWidget::~KoShadowConfigWidget()
-{
- delete d;
-}
-
-void KoShadowConfigWidget::setShadowColor(const QColor &color)
-{
- d->widget.shadowColor->blockSignals(true);
- d->actionShadowColor->blockSignals(true);
-
- d->actionShadowColor->setCurrentColor( color );
-
- d->actionShadowColor->blockSignals(false);
- d->widget.shadowColor->blockSignals(false);
-}
-
-QColor KoShadowConfigWidget::shadowColor() const
-{
- return d->actionShadowColor->currentColor();
-}
-
-void KoShadowConfigWidget::setShadowOffset(const QPointF &offset)
-{
- qreal length = sqrt(offset.x()*offset.x() + offset.y()*offset.y());
- qreal angle = atan2(-offset.y(), offset.x());
- if (angle < 0.0) {
- angle += 2*M_PI;
- }
-
- d->widget.shadowAngle->blockSignals(true);
- d->widget.shadowAngle->setValue(-90 - angle * 180.0 / M_PI);
- d->widget.shadowAngle->blockSignals(false);
-
- d->widget.shadowOffset->blockSignals(true);
- d->widget.shadowOffset->changeValue(length);
- d->widget.shadowOffset->blockSignals(false);
-}
-
-QPointF KoShadowConfigWidget::shadowOffset() const
-{
- QPointF offset(d->widget.shadowOffset->value(), 0);
- QTransform m;
- m.rotate(d->widget.shadowAngle->value() + 90);
- return m.map(offset);
-}
-
-void KoShadowConfigWidget::setShadowBlur(const qreal &blur)
-{
- d->widget.shadowBlur->blockSignals(true);
- d->widget.shadowBlur->changeValue(blur);
- d->widget.shadowBlur->blockSignals(false);
-}
-
-qreal KoShadowConfigWidget::shadowBlur() const
-{
- return d->widget.shadowBlur->value();
-}
-
-void KoShadowConfigWidget::setShadowVisible(bool visible)
-{
- d->widget.shadowVisible->blockSignals(true);
- d->widget.shadowVisible->setChecked(visible);
- d->widget.shadowVisible->blockSignals(false);
- visibilityChanged();
-}
-
-bool KoShadowConfigWidget::shadowVisible() const
-{
- return d->widget.shadowVisible->isChecked();
-}
-
-void KoShadowConfigWidget::visibilityChanged()
-{
- d->widget.shadowAngle->setEnabled( d->widget.shadowVisible->isChecked() );
- d->widget.shadowBlur->setEnabled( d->widget.shadowVisible->isChecked() );
- d->widget.shadowColor->setEnabled( d->widget.shadowVisible->isChecked() );
- d->widget.shadowOffset->setEnabled( d->widget.shadowVisible->isChecked() );
-}
-
-void KoShadowConfigWidget::applyChanges()
-{
- if (d->canvas) {
- KoSelection *selection = d->canvas->selectedShapesProxy()->selection();
- KoShape * shape = selection->firstSelectedShape();
- if (! shape) {
- return;
- }
-
- KoShapeShadow *newShadow = new KoShapeShadow();
- newShadow->setVisible(shadowVisible());
- newShadow->setColor(shadowColor());
- newShadow->setOffset(shadowOffset());
- newShadow->setBlur(shadowBlur());
- d->canvas->addCommand(new KoShapeShadowCommand(selection->selectedShapes(), newShadow));
- }
-}
-
-void KoShadowConfigWidget::selectionChanged()
-{
- if (! d->canvas) {
- return;
- }
-
- KoSelection *selection = d->canvas->selectedShapesProxy()->selection();
- KoShape * shape = selection->firstSelectedShape();
-
- setEnabled(shape != 0);
-
- if (! shape) {
- setShadowVisible(false);
- return;
- }
-
- KoShapeShadow * shadow = shape->shadow();
- if (! shadow) {
- setShadowVisible(false);
- return;
- }
-
- setShadowVisible(shadow->isVisible());
- setShadowOffset(shadow->offset());
- setShadowColor(shadow->color());
- setShadowBlur(shadow->blur());
-}
-
-void KoShadowConfigWidget::setCanvas(KoCanvasBase *canvas)
-{
- d->canvas = canvas;
- connect(canvas->selectedShapesProxy(), SIGNAL(selectionChanged()), this, SLOT(selectionChanged()));
- connect(canvas->selectedShapesProxy(), SIGNAL(selectionContentChanged()), this, SLOT(selectionChanged()));
-
- setUnit(canvas->unit());
-
- connect( d->canvas->resourceManager(), SIGNAL(canvasResourceChanged(int,QVariant)),
- this, SLOT(resourceChanged(int,QVariant)) );
-}
-
-void KoShadowConfigWidget::setUnitManagers(KisSpinBoxUnitManager* managerBlur, KisSpinBoxUnitManager *managerOffset)
-{
- d->widget.shadowOffset->blockSignals(true);
- d->widget.shadowBlur->blockSignals(true);
- d->widget.shadowOffset->setUnitManager(managerOffset);
- d->widget.shadowBlur->setUnitManager(managerBlur);
- d->widget.shadowOffset->blockSignals(false);
- d->widget.shadowBlur->blockSignals(false);
-}
-
-void KoShadowConfigWidget::setUnit(const KoUnit &unit)
-{
- d->widget.shadowOffset->blockSignals(true);
- d->widget.shadowBlur->blockSignals(true);
- d->widget.shadowOffset->setUnit(unit);
- d->widget.shadowBlur->setUnit(unit);
- d->widget.shadowOffset->blockSignals(false);
- d->widget.shadowBlur->blockSignals(false);
-}
-
-void KoShadowConfigWidget::resourceChanged( int key, const QVariant & res )
-{
- if( key == KoCanvasResource::Unit ) {
- setUnit(res.value<KoUnit>());
- }
-}
diff --git a/libs/widgets/KoShadowConfigWidget.h b/libs/widgets/KoShadowConfigWidget.h
deleted file mode 100644
index 9ccd89e825..0000000000
--- a/libs/widgets/KoShadowConfigWidget.h
+++ /dev/null
@@ -1,67 +0,0 @@
-/* This file is part of the KDE project
- * SPDX-FileCopyrightText: 2012 C. Boemann <[email protected]>
- * SPDX-FileCopyrightText: 2008 Jan Hambrecht <[email protected]>
- *
- * SPDX-License-Identifier: LGPL-2.0-or-later
- */
-
-#ifndef KOSHADOWCONFIGWIDGET_H
-#define KOSHADOWCONFIGWIDGET_H
-
-#include "kritawidgets_export.h"
-#include <QWidget>
-
-class KoUnit;
-class KoCanvasBase;
-class KisSpinBoxUnitManager;
-
-/// A widget for configuring the shadow of a shape
-class KRITAWIDGETS_EXPORT KoShadowConfigWidget : public QWidget
-{
- Q_OBJECT
-public:
- explicit KoShadowConfigWidget(QWidget *parent);
- ~KoShadowConfigWidget() override;
-
- /// Sets the shadow color
- void setShadowColor(const QColor &color);
-
- /// Returns the shadow color
- QColor shadowColor() const;
-
- /// Sets the shadow offset
- void setShadowOffset(const QPointF &offset);
-
- /// Returns the shadow offset
- QPointF shadowOffset() const;
-
- /// Sets the shadow blur radius
- void setShadowBlur(const qreal &blur);
-
- /// Returns the shadow blur radius
- qreal shadowBlur() const;
-
- /// Sets if the shadow is visible
- void setShadowVisible(bool visible);
-
- /// Returns if shadow is visible
- bool shadowVisible() const;
-
-public Q_SLOTS:
-
- void setUnitManagers(KisSpinBoxUnitManager* managerBlur, KisSpinBoxUnitManager* managerOffset);
- void setUnit( const KoUnit &unit );
- void setCanvas(KoCanvasBase *canvas);
-
-private Q_SLOTS:
- void visibilityChanged();
- void applyChanges();
- void selectionChanged();
- void resourceChanged( int key, const QVariant & res );
-
-private:
- class Private;
- Private *const d;
-};
-
-#endif // KOSHADOWCONFIGWIDGET_H
diff --git a/libs/widgets/KoShadowConfigWidget.ui b/libs/widgets/KoShadowConfigWidget.ui
deleted file mode 100644
index 082f2eed02..0000000000
--- a/libs/widgets/KoShadowConfigWidget.ui
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<ui version="4.0">
- <author>
- SPDX-FileCopyrightText: none
- SPDX-License-Identifier: GPL-3.0-or-later
- </author>
- <class>KoShadowConfigWidget</class>
- <widget class="QWidget" name="KoShadowConfigWidget">
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>238</width>
- <height>98</height>
- </rect>
- </property>
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <layout class="QGridLayout" columnstretch="0,0,1" name="gridLayout_3">
- <item column="0" row="0">
- <widget class="QCheckBox" name="shadowVisible">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item column="1" row="0" rowspan="2">
- <widget class="QDial" name="shadowAngle">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="maximumSize">
- <size>
- <width>48</width>
- <height>48</height>
- </size>
- </property>
- <property name="maximum">
- <number>359</number>
- </property>
- <property name="wrapping">
- <bool>true</bool>
- </property>
- <property name="notchTarget">
- <double>3.700000000000000</double>
- </property>
- </widget>
- </item>
- <item column="2" row="0">
- <layout class="QGridLayout" columnstretch="0,0,1" name="gridLayout_2">
- <item column="0" row="0">
- <widget class="QToolButton" name="shadowColor">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- <item column="1" row="0">
- <widget class="QLabel" name="label_2">
- <property name="text">
- <string>Blur:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item column="2" row="0">
- <widget class="KisDoubleParseUnitSpinBox" name="shadowBlur"/>
- </item>
- </layout>
- </item>
- <item column="2" row="1">
- <layout class="QGridLayout" columnstretch="0,1" name="gridLayout">
- <item column="0" row="0">
- <widget class="QLabel" name="label">
- <property name="text">
- <string>Distance:</string>
- </property>
- <property name="alignment">
- <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
- </property>
- </widget>
- </item>
- <item column="1" row="0">
- <widget class="KisDoubleParseUnitSpinBox" name="shadowOffset"/>
- </item>
- </layout>
- </item>
- <item column="1" row="2">
- <widget class="QWidget" name="SpecialSpacer" native="true">
- <property name="sizePolicy">
- <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <customwidgets>
- <customwidget>
- <class>KisDoubleParseUnitSpinBox</class>
- <extends>QDoubleSpinBox</extends>
- <header>kis_double_parse_unit_spin_box.h</header>
- </customwidget>
- </customwidgets>
- <resources/>
- <connections/>
-</ui>
\ No newline at end of file