mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 10:50:00 +00:00
Support default-font-* properties in Live-Preview
... by changing the resolution for the `WindowItem` to traverse the item tree from the current item, instead of going to the window. This doesn't quite fix #4298 because `rem` resolution is still missing. That requires the built-in default font size function to be fixed as well, which is non-trivial. cc #4298
This commit is contained in:
parent
7c02bbd833
commit
eb825f2e95
32 changed files with 189 additions and 86 deletions
|
@ -3916,13 +3916,15 @@ fn compile_builtin_function_call(
|
|||
BuiltinFunction::ImplicitLayoutInfo(orient) => {
|
||||
if let [llr::Expression::PropertyReference(pr)] = arguments {
|
||||
let native = native_prop_info(pr, ctx).0;
|
||||
let item_rc = access_item_rc(pr, ctx);
|
||||
format!(
|
||||
"{vt}->layout_info({{{vt}, const_cast<slint::cbindgen_private::{ty}*>(&{i})}}, {o}, &{window})",
|
||||
"slint::private_api::item_layout_info({vt}, const_cast<slint::cbindgen_private::{ty}*>(&{i}), {o}, &{window}, {item_rc})",
|
||||
vt = native.cpp_vtable_getter,
|
||||
ty = native.class_name,
|
||||
o = to_cpp_orientation(orient),
|
||||
i = access_member(pr, ctx),
|
||||
window = access_window_field(ctx)
|
||||
window = access_window_field(ctx),
|
||||
item_rc = item_rc
|
||||
)
|
||||
} else {
|
||||
panic!("internal error: invalid args to ImplicitLayoutInfo {arguments:?}")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue