Repository navigation
GTK4: 4 styling FFI gaps surfaced by #185 Phase B audit #202
Description
Context
The styling matrix added in #185 Phase A (crates/perry-ui/src/styling_matrix.rs) audits which styling FFIs are wired on each backend. After Phase B closures (v0.5.297–v0.5.303), every Apple platform + Android + Web is at 43/43 Wired. GTK4 sits at 39/43, with 4 real implementation gaps that can't be reasonably verified from the macOS dev host (no GTK4 toolchain) and warrant a focused Linux-side closure.
The 4 Missing rows
Generated from docs/src/ui/styling-matrix.md:
| Prop | FFI symbol | Recommendation |
|---|---|---|
widget.on_click |
perry_ui_widget_set_on_click |
widget.add_controller(GestureClick::new()) with connect_pressed invoking the registered closure |
button.content_tint_color |
perry_ui_button_set_content_tint_color |
CSS color override on Button > image selector via per-handle CssProvider (mirrors set_corner_radius pattern) |
button.image_position |
perry_ui_button_set_image_position |
Button::set_child(&Box) with image+label ordered by direction; or Button::child().downcast::<Box>().reorder_child_after() |
stack.detaches_hidden |
perry_ui_stack_set_detaches_hidden |
GTK4 already auto-detaches hidden children from layout; could be a no-op stub OR reuse Box::set_visible cascade — needs Linux verification |
What's needed
For each row above:
- Implementation in
crates/perry-ui-gtk4/src/widgets/mod.rs(or appropriate sub-module —button.rsfor the button-specific ones). - FFI export in
crates/perry-ui-gtk4/src/lib.rs—#[no_mangle] pub extern \"C\" fn perry_ui_<symbol>(...). - Matrix flip in
crates/perry-ui/src/styling_matrix.rsfromMissing→Wiredfor the GTK4 cell. Drift integration test (cargo test -p perry-ui) catches mismatches at CI time.
Why a separate issue
The macOS dev host can't easily cross-compile GTK4 (pkg-config for pango/gtk via system, libmimalloc-sys build issues). The CI ubuntu-22.04 runner has GTK4 system libs and can build cleanly. A Linux contributor or a CI-only PR is the natural path.
Verification
Once landed, cargo test -p perry-ui must remain green (the styling matrix integration test scans crates/perry-ui-gtk4/src/lib.rs for the new FFI exports and fails on drift).
Quick verification flow:
# After implementing each FFI export:
./target/debug/styling-matrix --check # validates lib.rs vs matrix
./target/debug/styling-matrix --gen # regenerates docs/src/ui/styling-matrix.md
git diff --exit-code -- docs/src/ui/styling-matrix.md # CI guardCloses
Once landed: GTK4 reaches 43/43 Wired alongside Apple+Android+Web. Only Windows-deferred-paint family (5 stubs) remains for full Phase B styling closure on issue #185.
Activity
feat(ui): PerryTS#185 Phase C step 1 — StyleProps type surface (v0.5.…
docs(ui): #185 epilogue — styling docs + Windows tracking issue (v0.5…
fix(release): triage parity gaps + re-bless Linux gallery baseline (v…