Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding transparent windows information to the Window API tutorial #1601

Merged
merged 2 commits into from
Dec 16, 2021

Conversation

akurasov
Copy link
Contributor

Also closes #1339

@akurasov akurasov requested a review from Rsedaikin December 15, 2021 17:56
}
```

_Important note: Window transparency is implemented based on JDK implementation, that contains known issue in case of moving a Window between two monitors with different density. So when you move an App, the Window stops being transparent. And it seems nothing can be done with this situation on Compose side.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a Linux only issue. Everything is fine on macOS and Windows.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@@ -605,3 +605,46 @@ private fun WindowScope.AppWindowTitleBar() = WindowDraggableArea {
}
```
<img alt="Draggable area" src="draggable_area.gif" height="239" />

## Transparent windows (e.g. allows to make windows of a custom form)
To create a transparent window it is enough to pass two parameners to the Window function: transparent=true and undecorate=true (it is not possible to decorate a transparent Window). Common scenario is to combine transparent window with a Surface of a custom form. Below is an example of a round-cornered Window.
Copy link
Contributor

@Rsedaikin Rsedaikin Dec 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should quote parameters/methods/classes and other appropriate names. Like
transparent=true

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@akurasov akurasov requested a review from Rsedaikin December 16, 2021 10:35
@akurasov akurasov merged commit 2640730 into master Dec 16, 2021
@akurasov akurasov deleted the akurasov-transparent-window-doc branch December 16, 2021 11:20
mareklangiewicz pushed a commit to mareklangiewicz/compose-jb that referenced this pull request Feb 14, 2022
…tBrains#1601)

* Adding transparent windows information

Also closes JetBrains#1339

* Update README.md
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with transparency on Linux
2 participants