Commit graph

134 commits

Author SHA1 Message Date
Olivier Goffart
cf49568373 Compiler: make the image processing an enum in the config 2022-03-24 13:16:21 +01:00
Olivier Goffart
41b20fdd59 MCU build system: pass information about embedding images and glyph to the compiler
... using metadata from the build script send with the DEP_I_SLINT_BACKEND_MCU

Saves two environment variable that we don't have to pass
2022-03-24 13:16:21 +01:00
Simon Hausmann
535e134223 Add a Layer element that's created when using a layer boolean property
For now no backend implements this optimization hint.
2022-03-21 20:22:43 +01:00
Olivier Goffart
6c7a7aed0e Error out when a PopupWindow is in a if or for
instead of panicking

We need to mve stuff in the parent element and that doesn't work if
it is a repeated element. Also there would not be ways to call show
on it anyway.

Fixes #1079
2022-03-21 12:50:49 +01:00
Olivier Goffart
6653651199 Fixes Listview's element height when the height is specified in the parent sub-component
Fixes #1057
2022-03-17 09:04:32 +01:00
Simon Hausmann
43759cd1bb Fix elided text rendering on mcu
Commit aee3ffca27 accidentally removed the elision character
2022-03-10 11:43:01 +01:00
Simon Hausmann
aee3ffca27 Add additional glyphs for embedding
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
2022-03-10 10:51:32 +01:00
Simon Hausmann
abca5bed78 Include elision character in bitmap glyphs 2022-03-10 10:51:32 +01:00
Simon Hausmann
f5a34b3df0 Add colon to the list of hard-coded glyphs to cover 2022-03-10 10:51:32 +01:00
Olivier Goffart
8bf47a2b74 Properly compute the binding priority in case of several level of inlining
The problem is that if some bindings are coming from already inlined elements
they should have a higher priority field, so that whenmerging the two way
binding, we keep the least deep value

Fixes: #1026
2022-03-09 17:43:28 +01:00
Olivier Goffart
a0c914c43e Mark aliases as used (and potentially overwritten) by derived component
Fix #1009
2022-03-04 11:50:06 +01:00
Simon Hausmann
738ac0dc01 mcu: scale images at compile time (#966)
Apply a scale factor to reduce the size of embedded images at compile
time.
2022-03-03 13:28:47 +01:00
Olivier Goffart
0dc188f328 Support for referring to other globals from globals
- 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
2022-02-28 10:14:34 +01:00
Olivier Goffart
55fb9c13aa Mark the y properties of elements within a ListView as "set"
... 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
2022-02-25 17:20:09 +01:00
Simon Hausmann
668e02aa83 Fix glyph embedding on Linux
Copy the fontconfig code from the GL backend to find out what the font for "sans-serif" is, in case we need a fallback.
2022-02-23 12:13:10 +01:00
Simon Hausmann
f912ec7e6b Fix scaling of glyphs and improve type safety in the MCU backend
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
2022-02-17 15:07:57 +01:00
Olivier Goffart
b31b3e112a Mark public properties as set
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
2022-02-16 18:46:37 +01:00
Simon Hausmann
27a8c33c07 janitor: fix wasm build of the compiler
Seems weird, but the wasm-interpreter needs the compiler lib :)
2022-02-15 16:03:17 +01:00
Simon Hausmann
07da5c1c36 janitor: Fix license headers 2022-02-15 15:55:41 +01:00
Simon Hausmann
304e06f758 Begin rasterizing glyphs for glyph embedding
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.
2022-02-15 15:52:24 +01:00
Tobias Hunger
4230ac2572
Update copyright information to reflect name change
Also run resue over the codebase and fix complaints from that tool.
2022-02-09 10:27:47 +01:00
Olivier Goffart
00ff5e21a7 Update git repository URL 2022-02-08 08:26:21 +01:00
Olivier Goffart
91e107150e Merge remote-tracking branch 'origin/wip/rename'
Conflicts:
	examples/opengl_underlay/index.html
	examples/opengl_underlay/main.cpp
2022-02-08 07:29:41 +01:00
Olivier Goffart
c5a2e96755 Fix opacity on Image in for in layout
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
2022-02-07 18:07:09 +01:00
Olivier Goffart
2816a09911 Fix a panic occuring when some layout may still contains reference to optimized item
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
2022-02-07 18:07:09 +01:00
Tobias Hunger
03f78af987
Update some .60 to .slint 2022-02-02 17:29:40 +01:00
Olivier Goffart
d4c1130130 Rename more occurences 2022-02-02 17:19:31 +01:00
Tobias Hunger
1a0a495bc5
Rename environment variables 2022-02-02 13:35:07 +01:00
Olivier Goffart
692171bf0c Change the 60 blocks to slint blocs in documentation comments 2022-02-02 10:51:42 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Olivier Goffart
0308f86cd4 Rename sixtyfps_widgets.60 to std-widgets.slint 2022-02-01 18:58:54 +01:00
Tobias Hunger
0d358251c9 Janitor: More clippy stuff 2022-01-31 20:59:45 +01:00
Tobias Hunger
cc568a63f5 Janitor: Fix stray @ in patterns 2022-01-31 20:59:45 +01:00
Tobias Hunger
e6b24bceec [reorg]: Set up and populate the internal directory
Move "internal" crates into the `internal` directory. This first batch
includes most of sixtyfps_runtime but leaves the rendering backends
alone for now.

pre-commit applied some cleanups to the moved files:
 - Consistent newline at end of file policy
 - trimming trailing whitespace
 - Formatting Cargo.toml files.
2022-01-31 16:00:50 +01:00