|
1 | 1 | # Decorated Window |
2 | 2 |
|
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. |
4 | 4 |
|
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: |
6 | 10 |
|
7 | 11 | - **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 |
9 | 13 | - **`DecoratedDialog`** — custom title bar for dialog windows, which Jewel does not provide |
10 | 14 | - **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) |
11 | 15 |
|
@@ -84,16 +88,17 @@ dependencies { |
84 | 88 | } |
85 | 89 | ``` |
86 | 90 |
|
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. |
88 | 92 |
|
89 | 93 | ```kotlin |
90 | 94 | dependencies { |
| 95 | + // Optional — only needed if you use MaterialDecoratedWindow / MaterialTitleBar |
91 | 96 | implementation("io.github.kdroidfilter:nucleus.decorated-window-material:<version>") |
92 | 97 | } |
93 | 98 | ``` |
94 | 99 |
|
95 | 100 | !!! 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. |
97 | 102 |
|
98 | 103 | ## Quick Start |
99 | 104 |
|
|
0 commit comments