Skip to content

Commit 3b19c21

Browse files
committed
Document transparent parameter usage in TrayApp with examples
- Added a new section in the README explaining the `transparent` parameter for `TrayApp`. - Included usage examples for configuring window transparency. - Clarified the default behavior and platform support for transparency.
1 parent e1438d1 commit 3b19c21

1 file changed

Lines changed: 30 additions & 0 deletions

File tree

README.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,36 @@ trayAppState.setWindowSize(400.dp, 600.dp)
646646
trayAppState.setWindowSize(DpSize(350.dp, 500.dp))
647647
```
648648

649+
#### Window Transparency
650+
By default, the tray popup window is created with a transparent background so your UI can have rounded corners and shadows without a visible window frame.
651+
You can turn transparency off if you prefer an opaque window.
652+
653+
- Default: `transparent = true`
654+
- Opaque window: set `transparent = false`
655+
656+
Example:
657+
```kotlin
658+
@OptIn(ExperimentalTrayAppApi::class)
659+
application {
660+
val trayAppState = rememberTrayAppState(
661+
initialWindowSize = DpSize(320.dp, 420.dp),
662+
initiallyVisible = true
663+
)
664+
665+
TrayApp(
666+
state = trayAppState,
667+
icon = Icons.Default.Dashboard,
668+
tooltip = "My Tray App",
669+
transparent = false, // 👈 make the popup opaque
670+
) {
671+
// Your popup content
672+
MaterialTheme { /* ... */ }
673+
}
674+
}
675+
```
676+
677+
Note: The fade-in/out animation in TrayApp controls the content alpha (visual fade) and is independent from window transparency. Transparency support is available on Linux, Windows, and macOS.
678+
649679
## 🧩 New: Tray Window Dismiss Modes
650680

651681
By default, the `TrayApp` popup window closes automatically when it loses focus or when the user clicks outside of it.

0 commit comments

Comments
 (0)