Skip to content

Commit 2fd993c

Browse files
committed
docs: clarify decorated window features and design system agnosticism
Expand documentation to explain design system independence, optional Material 3 module usage, and implementation details on macOS, Windows, and Linux.
1 parent b9cc76f commit 2fd993c

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

docs/runtime/decorated-window.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
# Decorated Window
22

3-
Compose for Desktop does not allow drawing custom content in the title bar while keeping native window controls and native behavior (drag, resize, double-click maximize). You must choose between a native title bar you cannot customize, or a fully undecorated window where you reimplement everything from scratch.
3+
Compose for Desktop does not natively expose a way to draw custom content in the title bar while keeping native window controls and behavior (drag, resize, double-click maximize). On macOS, the underlying Swing layer does offer `JRootPane` client properties (such as `apple.awt.fullWindowContent` and `apple.awt.transparentTitleBar`) that let you extend Compose content into the title bar area while keeping native traffic lights — but this is a Swing-level mechanism, not a Compose API, and it does not give you a composable layout model for the title bar. On Windows and Linux there is no equivalent — your only option is a fully undecorated window where you reimplement everything from scratch.
44

5-
The decorated window modules bridge this gap. They are a fork of [Jewel](https://github.com/JetBrains/intellij-community/tree/master/platform/jewel)'s decorated window, **without any dependency on Jewel itself**. Key differences from Jewel:
5+
The decorated window modules bridge this gap. They are **completely design-system agnostic** — no dependency on Jewel, no dependency on Material 3. You wire in whatever color tokens your app uses (Material 3, Jewel, your own design system, or a plain `Color` literal).
6+
7+
The optional [`decorated-window-material`](decorated-window-material.md) module exists as a convenience layer that reads `MaterialTheme.colorScheme` automatically — but it is a separate artifact and is not required by the base modules.
8+
9+
The implementation was originally inspired by [Jewel](https://github.com/JetBrains/intellij-community/tree/master/platform/jewel)'s decorated window. Key divergences from Jewel's own implementation:
610

711
- **No JNA** — all native calls use JNI only, removing the JNA dependency entirely
8-
- **Design-system agnostic**no Material dependency; easily map any theme (Material 3, Jewel, your own) to its styling tokens
12+
- **No Jewel dependency**the base modules have zero runtime dependency on Jewel
913
- **`DecoratedDialog`** — custom title bar for dialog windows, which Jewel does not provide
1014
- **Reworked Linux rendering** — the entire Linux experience has been rebuilt from the ground up to look as native as possible, even though everything is drawn with Compose: platform-accurate GNOME Adwaita and KDE Breeze window controls, proper window shape clipping, border styling, and full behavior emulation (drag, double-click maximize, focus-aware button states)
1115

@@ -84,16 +88,17 @@ dependencies {
8488
}
8589
```
8690

87-
If you use Material 3, add the companion module:
91+
**Optionally**, if you use Material 3 and want automatic `MaterialTheme.colorScheme` wiring, add the companion module. This is **not required** for the base decorated window to work.
8892

8993
```kotlin
9094
dependencies {
95+
// Optional — only needed if you use MaterialDecoratedWindow / MaterialTitleBar
9196
implementation("io.github.kdroidfilter:nucleus.decorated-window-material:<version>")
9297
}
9398
```
9499

95100
!!! note
96-
See [`decorated-window-material`](decorated-window-material.md) for automatic `MaterialTheme.colorScheme` wiring.
101+
See [`decorated-window-material`](decorated-window-material.md) for details on the Material 3 wrappers. If you use a different design system (Jewel, a custom theme, etc.), skip this module and map your colors manually as shown in the [Styling](#styling) section below.
97102

98103
## Quick Start
99104

0 commit comments

Comments
 (0)