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.rs for 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.rs from Missing → Wired for 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 guard
Closes
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.
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:widget.on_clickperry_ui_widget_set_on_clickwidget.add_controller(GestureClick::new())withconnect_pressedinvoking the registered closurebutton.content_tint_colorperry_ui_button_set_content_tint_colorButton > imageselector via per-handleCssProvider(mirrorsset_corner_radiuspattern)button.image_positionperry_ui_button_set_image_positionButton::set_child(&Box)with image+label ordered by direction; orButton::child().downcast::<Box>().reorder_child_after()stack.detaches_hiddenperry_ui_stack_set_detaches_hiddenBox::set_visiblecascade — needs Linux verificationWhat's needed
For each row above:
crates/perry-ui-gtk4/src/widgets/mod.rs(or appropriate sub-module —button.rsfor the button-specific ones).crates/perry-ui-gtk4/src/lib.rs—#[no_mangle] pub extern \"C\" fn perry_ui_<symbol>(...).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-configfor pango/gtk via system,libmimalloc-sysbuild 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-uimust remain green (the styling matrix integration test scanscrates/perry-ui-gtk4/src/lib.rsfor the new FFI exports and fails on drift).Quick verification flow:
Closes
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.