forked from quickshell/quickshell
core/window: add QsWindow attached object to contained Items
This commit is contained in:
parent
d1c33d48cd
commit
e48af44607
4 changed files with 75 additions and 1 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <qregion.h>
|
||||
#include <qtmetamacros.h>
|
||||
#include <qtypes.h>
|
||||
#include <qvariant.h>
|
||||
#include <qwindow.h>
|
||||
|
||||
#include "generation.hpp"
|
||||
|
@ -123,6 +124,8 @@ void ProxyWindowBase::connectWindow() {
|
|||
generation->registerIncubationController(this->window->incubationController());
|
||||
}
|
||||
|
||||
this->window->setProperty("__qs_proxywindow", QVariant::fromValue(this));
|
||||
|
||||
// clang-format off
|
||||
QObject::connect(this->window, &QWindow::visibilityChanged, this, &ProxyWindowBase::visibleChanged);
|
||||
QObject::connect(this->window, &QWindow::xChanged, this, &ProxyWindowBase::xChanged);
|
||||
|
@ -344,3 +347,6 @@ QQmlListProperty<QObject> ProxyWindowBase::data() {
|
|||
|
||||
void ProxyWindowBase::onWidthChanged() { this->mContentItem->setWidth(this->width()); }
|
||||
void ProxyWindowBase::onHeightChanged() { this->mContentItem->setHeight(this->height()); }
|
||||
|
||||
QObject* ProxyWindowAttached::window() const { return this->mWindow; }
|
||||
QQuickItem* ProxyWindowAttached::contentItem() const { return this->mWindow->contentItem(); }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue