Commit graph

1514 commits

Author SHA1 Message Date
Lukas Jung
8240531e6e move actual-current-item to FocusScope 2022-03-16 08:48:30 +01:00
Lukas Jung
9d18882f9d reset StandardListView's current-item if it is out of bounds 2022-03-16 08:48:30 +01:00
Tobias Hunger
ea684fa4de Add item_tree function to Component VTable 2022-03-14 17:19:31 +01:00
Tobias Hunger
bdc3778cec Rename init/free item functions back 2022-03-14 09:43:50 +01:00
Tobias Hunger
095537e3fd Remove item from ItemTreeNode
... and make ItemTreeNode non-generic this way.

The Item is now only in the extra ItemArray struct and we are free to
expose the ItemTree further.
2022-03-14 09:43:50 +01:00
Tobias Hunger
5d3f296af9 API: Change WindowRc::free_graphics_resources and init_items on C++
Use the ItemArray in both cases.
2022-03-14 09:43:50 +01:00
Tobias Hunger
1fd14272cf Use item_array in C++ 2022-03-14 09:43:50 +01:00
Tobias Hunger
6681545aca Use item_array in rust 2022-03-14 09:43:50 +01:00
Tobias Hunger
b95342551b Add index into item_array into ItemTreeNode 2022-03-14 09:43:50 +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
ogoffart
7b50791db4 Bump version number to 0.2.2 2022-03-10 08:48:33 +00: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
7d6c1f375a Properly error out when element type are used within composite types
Fix #1021
2022-03-09 09:22:27 +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
583c7a1b80 Fix C++ build
With ImageInner::StaticTextures (the variant) and StaticTextures (the
struct), we need to disambiguate for the generated enum contructor
functions. This is done by prefixing the enum variant with their name.
2022-03-03 14:39:11 +01:00
Simon Hausmann
f1dae75d53 Fix interpreter ffi build
Commit 738ac0dc01 increased the size of the ImageInner::StaticTextures variant,
which breaks the size assertions in the interpreter ffi build.

This changes fixes that by reducing the size of the ImageInner variant again by
moving all the fields into a separate struct.
2022-03-03 14:04:45 +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
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