Skip to content

Commit

Permalink
Wasm: Add support for setOpacity() in QWasmWindow
Browse files Browse the repository at this point in the history
Add support for QPlatformWindow::setOpacity() in QWasmWindow.

Change-Id: Ib54cecf1f49e3d576a386f4109b8c6df1f16f312
Reviewed-by: Mikołaj Boc <[email protected]>
  • Loading branch information
Piotr Wierciński committed Mar 14, 2023
1 parent 20668ba commit c996147
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/plugins/platforms/wasm/qwasmwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,11 @@ void QWasmWindow::propagateSizeHints()
m_nonClientArea->propagateSizeHints();
}

void QWasmWindow::setOpacity(qreal level)
{
m_qtWindow["style"].set("opacity", qBound(0.0, level, 1.0));
}

void QWasmWindow::invalidate()
{
m_compositor->requestUpdateWindow(this);
Expand Down
1 change: 1 addition & 0 deletions src/plugins/platforms/wasm/qwasmwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ class QWasmWindow final : public QPlatformWindow
QMargins frameMargins() const override;
WId winId() const override;
void propagateSizeHints() override;
void setOpacity(qreal level) override;
void raise() override;
void lower() override;
QRect normalGeometry() const override;
Expand Down

0 comments on commit c996147

Please sign in to comment.