core/window: add QsWindow.devicePixelRatio

This commit is contained in:
outfoxxed 2025-01-22 03:33:46 -08:00
parent bc73d35d03
commit b336129c34
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
9 changed files with 48 additions and 0 deletions

View file

@ -192,6 +192,7 @@ WaylandPanelInterface::WaylandPanelInterface(QObject* parent)
QObject::connect(this->layer, &ProxyWindowBase::backerVisibilityChanged, this, &WaylandPanelInterface::backingWindowVisibleChanged);
QObject::connect(this->layer, &ProxyWindowBase::heightChanged, this, &WaylandPanelInterface::heightChanged);
QObject::connect(this->layer, &ProxyWindowBase::widthChanged, this, &WaylandPanelInterface::widthChanged);
QObject::connect(this->layer, &ProxyWindowBase::devicePixelRatioChanged, this, &WaylandPanelInterface::devicePixelRatioChanged);
QObject::connect(this->layer, &ProxyWindowBase::screenChanged, this, &WaylandPanelInterface::screenChanged);
QObject::connect(this->layer, &ProxyWindowBase::windowTransformChanged, this, &WaylandPanelInterface::windowTransformChanged);
QObject::connect(this->layer, &ProxyWindowBase::colorChanged, this, &WaylandPanelInterface::colorChanged);
@ -218,10 +219,13 @@ void WaylandPanelInterface::onReload(QObject* oldInstance) {
QQmlListProperty<QObject> WaylandPanelInterface::data() { return this->layer->data(); }
ProxyWindowBase* WaylandPanelInterface::proxyWindow() const { return this->layer; }
QQuickItem* WaylandPanelInterface::contentItem() const { return this->layer->contentItem(); }
bool WaylandPanelInterface::isBackingWindowVisible() const {
return this->layer->isVisibleDirect();
}
qreal WaylandPanelInterface::devicePixelRatio() const { return this->layer->devicePixelRatio(); }
// NOLINTBEGIN
#define proxyPair(type, get, set) \
type WaylandPanelInterface::get() const { return this->layer->get(); } \

View file

@ -146,6 +146,8 @@ public:
[[nodiscard]] qint32 height() const override;
void setHeight(qint32 height) override;
[[nodiscard]] virtual qreal devicePixelRatio() const override;
[[nodiscard]] QuickshellScreenInfo* screen() const override;
void setScreen(QuickshellScreenInfo* screen) override;