1# sctk-adwaita, vendored
2
3Upstream: [sctk-adwaita](https://github.com/PolyMeilex/sctk-adwaita) 0.10.1 from
4crates.io (the version winit resolves to in `Cargo.lock`), copied without its
5`examples/`, `Cargo.lock` and CI files. The workspace `Cargo.toml` points
6`[patch.crates-io]` here.
7
8`Cargo.toml` gains a `[lints.rust]` table silencing a lint newer than the
9release, since Cargo does not cap a path dependency's warnings, and takes
10tiny-skia 0.12, as resvg does, in place of 0.11, whose API it shares. The first source
11change drops the 1 px border line under the header bar, so the title
12bar flows into Snowbound's toolbar as it does in a GTK 4 app:
13
14```diff
15--- a/src/lib.rs
16+++ b/src/lib.rs
17@@ fn draw_headerbar_bg(
18 None,
19 );
20
21- pixmap.fill_rect(
22- Rect::from_xywh(0., h - 1., w, h)?,
23- &colors.border_paint(),
24- Transform::identity(),
25- None,
26- );
27-
28 Some(())
29 }
30```
31
32The second change serves GNOME, where Snowbound cuts its window's bottom
33corners as libadwaita does. With `LIBADWAITA_EDGE` set, the frame draws
34libadwaita 1.7's `window.csd` edge in place of its own border
35(`draw_libadwaita_edge`): the 15 px `WINDOW_RADIUS`, the box shadows focused
36and not with their 1 px ring, and the 7 % white outline 1 px inside the
37edge. The header keeps the body's width, the sides overlap the body by the
38outline and the bottom by the radius, so the frame paints the outline and the
39bottom corners' shadow over the application's pixels.
40
41The third change makes the header bar zero height, so Snowbound's toolbar row
42is the title bar, as a GTK 4 header bar holding tools is (`theme.rs`):
43
44```diff
45-pub(crate) const HEADER_SIZE: u32 = 35;
46+pub(crate) const HEADER_SIZE: u32 = 0;
47```
48
49Around it: `FRAMED` is set once a frame is made, which tells Snowbound to draw
50the title bar and the window's buttons itself; the empty header part is not
51drawn; the top part draws a border line as the bottom does; and with
52`LIBADWAITA_EDGE` the top part reaches down over the body's top corners by the
53radius, as the bottom reaches up, owning them from the sides, since Snowbound
54cuts those corners too.
55
56To bump: copy the new release's `src/`, `Cargo.toml`, `LICENSE`, `README.md`
57and `CHANGELOG.md` over this folder, reapply the three changes, and update the version
58above. The patch applies only while the version here satisfies winit's
59requirement; `cargo tree -i sctk-adwaita` shows the path source when it does.