Commit graph

95 commits

Author SHA1 Message Date
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
c9319add6a Export the input-type from the LineEdit 2022-03-02 21:55:49 +01:00
Lukas Jung
c15b0e1486 Add focus and keyboard control to native/qt spinbox 2022-03-02 17:51:31 +01:00
Lukas Jung
103b069dde implement keyboard control for fluent widget 2022-03-02 17:51:31 +01:00
Jared Moulton
b884a4ca19 Fix CI issues, remove references to replace-char, add a test, fix creation of string 2022-03-02 15:47:32 +01:00
Jared Moulton
fdbc8056b3 Add an option to draw *'s instead of characters for password fields 2022-03-02 15:47:32 +01:00
Simon Hausmann
19a3b67ac2 Use the new dark-style property to select about logo 2022-03-01 16:41:20 +01:00
n-raine
beda5aca07 Add dark style detection support for GL backend
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>
2022-03-01 16:41:20 +01:00
Olivier Goffart
9a6c306017 We can now access the global from other globals 2022-02-28 10:14:34 +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
Simon Hausmann
e15c8f0011 Bump fontdue dependency
After https://github.com/mooman219/fontdue/pull/103 was merged and released with 0.7.1,
we are now back to only one copy of ttf-parser.
2022-02-26 14:36:15 +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
b482105402 Bump femtovg, fontdb, usvg and resvg dependencies
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.
2022-02-21 09:10:11 +01:00
Olivier Goffart
ea4f27992e Mark constant properties of parent native type as such 2022-02-18 17:40:17 +01:00
Olivier Goffart
c941946f49 Debug: make sure that more properties have debug_name
The global properties, and base properties were not named

This adds a Property::new_named regardless if debug is enabled or not
2022-02-18 17:40:17 +01:00
Olivier Goffart
d70a304e2b fix slint_debug_property cfg build 2022-02-18 12:24:35 +01:00
Simon Hausmann
e30e18a450 janitor: Bump RazrFalcon's dependencies 2022-02-18 10:46:21 +01:00
Olivier Goffart
992507eadd Fix the inliner thinking property are not modified when they are 2022-02-17 16:25:48 +01:00
Olivier Goffart
a32eee64a7 Count the uses of property, and do not generate properties that are not used 2022-02-17 16:25:48 +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
2fbc23e174 Add an internal doc comment 2022-02-16 18:46:37 +01:00
Olivier Goffart
6f3668324f llr inlining: fix checking of builtin global properties 2022-02-16 18:46:37 +01:00
Olivier Goffart
85e88eb3d6 Silent warning in the generated code.
Inlining may cause global to become unused.
In a perfect world, We should remove the global completely instead, but
that will be for a followup patch
2022-02-16 18:46:37 +01:00
Olivier Goffart
3483ca17a7 LLR: optimization pass to inline property access
When the property access a binding that itself is only accessing one binding
2022-02-16 18:46:37 +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
Olivier Goffart
068a7a51b5 Rust generator: Fix type conversion when creating a Point
Before it used to always be a property access, but now it may be inlined
and result in a f64 or int expression
2022-02-16 18:46:37 +01:00
Olivier Goffart
dc3c91dd9f llr: Fix the type of LayoutCacheAccess
It access the element of the array.
This starts to be important when that expression starts being inlined
in more complex expressions
2022-02-16 18:46:37 +01:00
Olivier Goffart
21546722ad LLr: Add a pretty printer
It's far from complete, but already allow some debugging
2022-02-16 18:46:37 +01:00
Olivier Goffart
9f77e9a2e8 llr: note when a property binding is for a StateInfo 2022-02-16 18:46:37 +01:00
Olivier Goffart
a158c4b527 llr: Add visitors 2022-02-16 18:46:37 +01:00
Olivier Goffart
cc212c9d71 llr: keep property analysis 2022-02-16 18:46:37 +01:00
Olivier Goffart
9e938046ca llr: Add a helper function 2022-02-16 18:46:37 +01:00
Olivier Goffart
76a1bf8d7d LLR: Put the expression into a RefCell so they can be optimized 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
c072998719 Let's not hard-code the list of styles 2022-02-15 13:55:50 +01:00
Tobias Hunger
e5582a8a17 Update internal/compiler/typeloader.rs
Co-authored-by: Olivier Goffart <olivier@woboq.com>
2022-02-15 13:55:50 +01:00
Tobias Hunger
da0deb4119 Test style error when creating TypeLoader 2022-02-15 13:55:50 +01:00
Tobias Hunger
98cf796866 Scan for style files in the include directories 2022-02-15 13:55:50 +01:00
Tobias Hunger
0ee0eaf25e Simplify code a bit
... as suggested by @tronical

Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2022-02-15 13:55:50 +01:00
Tobias Hunger
e3908cfce6 Do not continue on errors when creating the TypeLoader 2022-02-15 13:55:50 +01:00
Tobias Hunger
d64dfa500c Error out when selecting unknown styles 2022-02-15 13:55:50 +01:00
Simon Hausmann
29cbb9e181 Change names of identifiers used for accessing embedded resources in the compiler
Instead of using SFPS (Slint_Fast_Packing_System) use SLINT :-)
2022-02-14 16:17:55 +01:00
ogoffart
ecd0fb7ecd Bump version number to 0.2.1 2022-02-10 16:25:28 +01:00
Tobias Hunger
58e7caafb0
Fix LICENSES symlinks 2022-02-09 17:05:47 +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
f0b047057b Fix HighDPI on windows with the rust generator and the native style and qt backend
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
2022-02-09 09:47:39 +01:00
Olivier Goffart
1425ef63de Change the Url from sixtyfps.io to slint-ui.com
Also, change the URL of the logo in the docs
2022-02-08 08:52:46 +01:00