diff --git a/kcmkwin/kwintabbox/thumbnailitem.cpp b/kcmkwin/kwintabbox/thumbnailitem.cpp index fffe6c4a2d..e96b3473a3 100644 --- a/kcmkwin/kwintabbox/thumbnailitem.cpp +++ b/kcmkwin/kwintabbox/thumbnailitem.cpp @@ -29,6 +29,7 @@ WindowThumbnailItem::WindowThumbnailItem(QQuickPaintedItem* parent) : QQuickPaintedItem(parent) , m_wId(0) , m_image() + , m_clipToItem(nullptr) { } @@ -43,6 +44,15 @@ void WindowThumbnailItem::setWId(qulonglong wId) findImage(); } +void WindowThumbnailItem::setClipTo(QQuickItem *clip) +{ + if (m_clipToItem == clip) { + return; + } + m_clipToItem = clip; + emit clipToChanged(); +} + void WindowThumbnailItem::findImage() { QString imagePath; diff --git a/kcmkwin/kwintabbox/thumbnailitem.h b/kcmkwin/kwintabbox/thumbnailitem.h index 6b4bca4002..f5d339ca78 100644 --- a/kcmkwin/kwintabbox/thumbnailitem.h +++ b/kcmkwin/kwintabbox/thumbnailitem.h @@ -31,6 +31,7 @@ class WindowThumbnailItem : public QQuickPaintedItem { Q_OBJECT Q_PROPERTY(qulonglong wId READ wId WRITE setWId NOTIFY wIdChanged SCRIPTABLE true) + Q_PROPERTY(QQuickItem *clipTo READ clipTo WRITE setClipTo NOTIFY clipToChanged) public: explicit WindowThumbnailItem(QQuickPaintedItem *parent = 0); virtual ~WindowThumbnailItem(); @@ -38,7 +39,11 @@ public: qulonglong wId() const { return m_wId; } + QQuickItem *clipTo() const { + return m_clipToItem; + } void setWId(qulonglong wId); + void setClipTo(QQuickItem *clip); virtual void paint(QPainter *painter) override; enum Thumbnail { @@ -49,10 +54,12 @@ public: }; Q_SIGNALS: void wIdChanged(qulonglong wid); + void clipToChanged(); private: void findImage(); qulonglong m_wId; QImage m_image; + QQuickItem *m_clipToItem; }; } // KWin