forked from quickshell/quickshell
widgets: add ClippingWrapperRectangle
This commit is contained in:
parent
401ee4cec6
commit
033e810871
7 changed files with 63 additions and 4 deletions
|
@ -11,7 +11,11 @@
|
|||
namespace qs::widgets {
|
||||
|
||||
void WrapperManager::componentComplete() {
|
||||
this->mWrapper = qobject_cast<QQuickItem*>(this->parent());
|
||||
if (this->mAssignedWrapper) {
|
||||
this->mWrapper = this->mAssignedWrapper;
|
||||
} else {
|
||||
this->mWrapper = qobject_cast<QQuickItem*>(this->parent());
|
||||
}
|
||||
|
||||
if (!this->mWrapper) {
|
||||
QString pstr;
|
||||
|
@ -118,6 +122,17 @@ void WrapperManager::onChildDestroyed() {
|
|||
emit this->childChanged();
|
||||
}
|
||||
|
||||
QQuickItem* WrapperManager::wrapper() const { return this->mWrapper; }
|
||||
|
||||
void WrapperManager::setWrapper(QQuickItem* wrapper) {
|
||||
if (this->mWrapper) {
|
||||
qmlWarning(this) << "Cannot set wrapper after WrapperManager initialization.";
|
||||
return;
|
||||
}
|
||||
|
||||
this->mAssignedWrapper = wrapper;
|
||||
}
|
||||
|
||||
void WrapperManager::printChildCountWarning() const {
|
||||
qmlWarning(this->mWrapper) << "Wrapper component cannot have more than one visual child.";
|
||||
qmlWarning(this->mWrapper) << "Remove all additional children, or pick a specific component "
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue