core/window: fix mask reactivity

Masks previously would not update if the item was changed, and full
transparency was decided incorrectly.
This commit is contained in:
outfoxxed 2024-03-20 22:32:34 -07:00
parent 31264ac7d1
commit dd811ac423
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 9 additions and 10 deletions

View file

@ -26,10 +26,14 @@ void PendingRegion::setItem(QQuickItem* item) {
this->mItem = item;
QObject::connect(this->mItem, &QQuickItem::xChanged, this, &PendingRegion::itemChanged);
QObject::connect(this->mItem, &QQuickItem::yChanged, this, &PendingRegion::itemChanged);
QObject::connect(this->mItem, &QQuickItem::widthChanged, this, &PendingRegion::itemChanged);
QObject::connect(this->mItem, &QQuickItem::heightChanged, this, &PendingRegion::itemChanged);
if (item != nullptr) {
QObject::connect(this->mItem, &QQuickItem::xChanged, this, &PendingRegion::itemChanged);
QObject::connect(this->mItem, &QQuickItem::yChanged, this, &PendingRegion::itemChanged);
QObject::connect(this->mItem, &QQuickItem::widthChanged, this, &PendingRegion::itemChanged);
QObject::connect(this->mItem, &QQuickItem::heightChanged, this, &PendingRegion::itemChanged);
}
emit this->itemChanged();
}
void PendingRegion::onItemDestroyed() { this->mItem = nullptr; }