Fix rem support

After commit e04f028c91, the
default-font-size property on WindowItem isn't set anymore by default,
so BuiltinFunction::GetWindowDefaultFontSize, which reads it, would
return zero.

Instead, delegate to a run-time function where we can fall back to the
default from the renderer.

This patch changes rem.slint to use the newer syntax. The main change to
the test case though is to removal of the explicit default-font-size
property setting, so that we fall back to the value provided by the
renderer. This test relies on being run with the testing backend.

Fixes #8961
This commit is contained in:
Simon Hausmann 2025-08-18 16:00:58 +02:00 committed by Simon Hausmann
parent 007cfd26b9
commit 18740aa826
14 changed files with 57 additions and 23 deletions

View file

@ -230,9 +230,9 @@ public:
cbindgen_private::slint_register_bitmap_font(&inner, &font);
}
inline float default_font_size() const
inline float resolved_default_font_size() const
{
return cbindgen_private::slint_windowrc_default_font_size(&inner);
return cbindgen_private::slint_windowrc_resolved_default_font_size(&inner);
}
/// \private