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:
Simon Hausmann 2024-12-03 14:37:55 +01:00 committed by Simon Hausmann
parent 7c02bbd833
commit eb825f2e95
32 changed files with 189 additions and 86 deletions

View file

@ -170,6 +170,16 @@ inline float layout_cache_access(const SharedVector<float> &cache, int offset, i
size_t idx = size_t(cache[offset]) + repeater_index * 2;
return idx < cache.size() ? cache[idx] : 0;
}
template<typename VT, typename ItemType>
inline cbindgen_private::LayoutInfo
item_layout_info(VT *itemvtable, ItemType *item_ptr, cbindgen_private::Orientation orientation,
WindowAdapterRc *window_adapter, const ItemTreeRc &component_rc,
uint32_t item_index)
{
cbindgen_private::ItemRc item_rc { component_rc, item_index };
return itemvtable->layout_info({ itemvtable, item_ptr }, orientation, window_adapter, &item_rc);
}
} // namespace private_api
namespace private_api {