Commit 82757857 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

[decoration] Implement the size property

Summary: See D26937

Reviewers: #kwin, davidedmundson

Reviewed By: #kwin, davidedmundson

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D26939
parent 1b31bb23
......@@ -67,6 +67,7 @@ DecoratedClientImpl::DecoratedClientImpl(AbstractClient *client, KDecoration2::D
if (oldSize.height() != m_clientSize.height()) {
emit decoratedClient->heightChanged(m_clientSize.height());
}
emit decoratedClient->sizeChanged(m_clientSize);
}
);
connect(client, &AbstractClient::desktopChanged, this,
......@@ -273,6 +274,11 @@ int DecoratedClientImpl::height() const
return m_clientSize.height();
}
QSize DecoratedClientImpl::size() const
{
return m_clientSize;
}
bool DecoratedClientImpl::isMaximizedVertically() const
{
return m_client->requestedMaximizeMode() & MaximizeVertical;
......
......@@ -66,6 +66,7 @@ public:
QPalette palette() const override;
QColor color(KDecoration2::ColorGroup group, KDecoration2::ColorRole role) const override;
bool providesContextHelp() const override;
QSize size() const override;
int width() const override;
WId windowId() const override;
......
......@@ -111,6 +111,11 @@ PreviewClient::PreviewClient(DecoratedClient *c, Decoration *decoration)
connect(this, &PreviewClient::bordersLeftEdgeChanged, this, emitEdgesChanged);
connect(this, &PreviewClient::bordersRightEdgeChanged, this, emitEdgesChanged);
connect(this, &PreviewClient::bordersBottomEdgeChanged, this, emitEdgesChanged);
auto emitSizeChanged = [this, c]() {
emit c->sizeChanged(c->size());
};
connect(this, &PreviewClient::widthChanged, this, emitSizeChanged);
connect(this, &PreviewClient::heightChanged, this, emitSizeChanged);
qApp->installEventFilter(this);
}
......@@ -133,6 +138,11 @@ int PreviewClient::height() const
return m_height;
}
QSize PreviewClient::size() const
{
return QSize(m_width, m_height);
}
QString PreviewClient::caption() const
{
return m_caption;
......
......@@ -90,6 +90,7 @@ public:
int width() const override;
int height() const override;
QSize size() const override;
QPalette palette() const override;
QColor color(ColorGroup group, ColorRole role) const override;
Qt::Edges adjacentScreenEdges() const override;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment