With the help of dark-light crate this is now exposed as dark-style
boolean property in NativeStyleMetrics.
Co-authored-by: Olivier Goffart <olivier@slint-ui.com>
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
- We need to make sure that the initialization of global is in the right order.
- In C++ and rust, we need to add accessor to the global component
- There can be `PropertyReference::Global` in binding of globals
- The interpreter globals need to hold references to the global they may depend on
Fixes#175
... also for oarent component.
The previous code did not set it as set for the parent components
causing the properties to be marked as const while they shouldn't
Fixes#983
This re-aligns the ttf-parser and rustybuzz dependencies in the GL
backend. There's still one other version of ttf-parser pulled into the
compiler due to fontdue, but that's minor.
The code was mixing logical and physical sizes, causing glyphs being
doubly scaled down. Instead, this patch introduces:
* Physical* and Logical* euclid length/size/rect aliases
* some extraction traits for getting the scalars in rects/sizes as lengths (until euclid has them
built-in)
* wrapper traits/types for safely extracting the physical font metrics the
compiler generates (i16)
* Fix a bug in the text height calculation where we failed to take the
descent into account
Since they can be set from the native code
The current code in NamedReference::is_constant and such always check for
expose_in_public_api already, this is now redundent
Enable with `SLINT_EMBED_GLYPHS=1` and select sizes like
`SLINT_FONT_SIZES=12,16`
This change just puts the data structures in place, rasterizes a fixed
subset, embeds that into the rust generated code and calls a backend
function for registering the font that is unimplemented.
We must create the window first to initialize the backend before
the style is called because it would initialize qt as a plugin instead
of as a proper application, and it would then not initialize the high dpi mode
Do the default_geometry pass before injecting elements:
The reason is that the defaut_geometry pass must know if an element is in
a layout and what kind of default geometry needs to be applied depending
on its actual structure, not whatever results after we injected elements
We were relying on the default_geometry pass to set the size of elements,
but that doesn't work for elements that are not covering 100% of their
parents by default. So to that manually instead.
Fixes#915
We need to simplify all the optimized items before the move_declaration pass
This include innter item of repeater that might be used by layouts
But that also means we can now uptimize children of layouts
The README.md contains the warning that used to be in lib.rs.
Add README.md files to all internal crates
... pointing to the official public crate to use instead.
Rename internal crates
fixup: README files
fixup rename