Commit graph

1507 commits

Author SHA1 Message Date
Simon Hausmann
66d12e3009 Implement draw_text in the MCU backend by means of i_slint_core::textlayout::layout_text_lines 2022-03-10 10:51:32 +01:00
Simon Hausmann
a555ad780a Adapt to TextShaper trait changes 2022-03-10 10:51:32 +01:00
Simon Hausmann
b9a7977ad3 Fix glyph cluster offset in the MCU pixel font "shaping"
Always specify a byte offset, even for absent glyphs.
2022-03-10 10:51:32 +01:00
Simon Hausmann
35644d4026 Implement text_size for the mcu backend with line breaks 2022-03-10 10:51:32 +01:00
Simon Hausmann
bf08ed2847 Begin implementing text layout traits 2022-03-10 10:51:32 +01:00
Simon Hausmann
b27dc9109a Clean up MCU font handling code a little
Dedicated a PixelFont struct to the combo of generic font and pixel-size matched glyphs.
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
5eecdb1ae7 MCU simulator: don't return from the event loop 2022-03-09 20:49:46 +01:00
Olivier Goffart
9259413ec2 MCU cleanup
- Attempt to unify a bit the features so we have less #[cfg] in the demo
 - Add a README
2022-03-09 20:49:46 +01:00
Lukas Jung
10dc49d294 don't draw lineEdit's focus ring if it is not enabled 2022-03-09 19:52:18 +01:00
Olivier Goffart
964670bc88 MCU renderer: refactor the drawing code in its own module 2022-03-09 08:34:28 +01:00
Simon Hausmann
e48e39bf61 Fix support for partial renderiung in the simulator
Keep a framebuffer around and re-create it if the size changes. Also
re-create the partial rendering cache then.
2022-03-07 21:14:50 +01:00
Simon Hausmann
7b721e15f7 Remove debug pixels from the simulator output 2022-03-07 21:14:50 +01:00
Olivier Goffart
fa22a90312 MCU: Improve a bit the touch driver for the XT2046
- Read the Z value and only mark the press when there is enough pressure
 - Callibrate with some value that works for me for the max and min coordinate
2022-03-07 14:23:08 +01:00
Olivier Goffart
f227bdaa35 MCU: rounded rectangles 2022-03-07 10:28:48 +01:00
Olivier Goffart
010be31f0c MCU renderer: Don't put the rectangle colors in a separate vector
The index size is the same as the size of the Color
2022-03-07 10:28:48 +01:00
Simon Hausmann
59f06ed1b2 janitor: remove unused dependency 2022-03-04 11:33:39 +01:00
Olivier Goffart
5447722014 MCU renderer: Fix dirty region and popup window
We must first compute the dirty region on every component before
creating the scene that will depends on the dirty regions
2022-03-03 17:51:02 +01:00
Olivier Goffart
b2caa757e7 Partial renderer: Initial work 2022-03-03 14:58:48 +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
Olivier Goffart
0027cab273 cargo fmt 2022-03-03 14:00:13 +01:00
Simon Hausmann
0316af5343 Add support for profiling in the mcu renderer (#968)
Profile different stages behind a slint_debug_performance cfg and feed the result into debug_log!

Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
2022-03-03 13:34:47 +01:00
Simon Hausmann
3a50755cab
Add MCU board config setup (#1006)
* Add MCU board config setup

Let the mcu backend provide the link flags via I_DEP_* and the
Slint-build crate now offers a function to allow printing Slint-specific
rustc flags.
2022-03-03 13:31:40 +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
a85482e5a4 Fix selection and clicking on password fields 2022-03-02 21:55:49 +01:00
Olivier Goffart
70bc75c267 Use a better character for the password replacement char
Also don't use the byte len, but the char length.
It's not entierly correct, but it's good enough
2022-03-02 21:55:49 +01:00
Lukas Jung
dba6f11aec make SpinBox only focusable if enabled 2022-03-02 17:51:31 +01:00
Lukas Jung
7e21e16e2e change the qstyle of NativeSpinBox when rendering 2022-03-02 17:51:31 +01:00
Lukas Jung
c15b0e1486 Add focus and keyboard control to native/qt spinbox 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
39a2290221
Build the backends without rtti unless needed (#1001)
* Build the backends without rtti unless needed

Only the interpreter needs the rtti generated code.

 * Since `SlintElement` emits `#[cfg(feature = "rtti")]` tokens, each
 crate using `SlintElement` needs to have an `rtti` feature.
 * The selector gets backend specific rtti selection features, in order
   for the interpreter to enable them.
* Enable rtti when building the C++ project with the interpreter enabled
2022-03-01 18:37:07 +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
0ab86bc0d1 Fix initialization of NativeStyleMetrics with the interpreter 2022-03-01 11:28:55 +01:00
Olivier Goffart
f7a0fda86c
Send a MouseExit event when the mouse leaves the window
Fixes #989
2022-03-01 11:23:39 +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
e3a33bd26a MCU renderer: Fix pixel access
We need to multiply by the bpp after the integer division
2022-02-24 10:52:43 +01:00
Olivier Goffart
6ecd9b5565 Upgrade qttypes
It now expose the flag via env variable, and allow to report
the reason why Qt was not found
2022-02-23 22:17:12 +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
Olivier Goffart
48a1b668b6 MCU: mark the scale_factor as a constant property 2022-02-21 20:11:59 +01:00
Tobias Hunger
f3feab1267
Implement ptr_eq for VWeak and PartialEq for Items (#976)
* Implement ptr_eq for VWeaks

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-02-21 17:45:18 +01:00
Tobias Hunger
6795d3ee00
Introduce a FocusEventResult enum (#975) 2022-02-21 17:43:41 +01:00
Olivier Goffart
ef33669c10 MCU: Don't add empty scene items
This fixes a division by zero.
2022-02-21 16:55:39 +01:00
Olivier Goffart
0998782402 MCU: Don't use f32 to compute the texture coordinate 2022-02-21 15:56:54 +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
27f1e099ae MCU: compile with just the std feature to test the Dummy backend on desktop 2022-02-18 11:52:54 +01:00
Simon Hausmann
e30e18a450 janitor: Bump RazrFalcon's dependencies 2022-02-18 10:46:21 +01:00
Simon Hausmann
a5ed38b43f Make the position of the SceneItem a PhysicalPoint
... instead of two x/y physical lengths.
2022-02-18 10:39:24 +01:00
Simon Hausmann
df49ef1c78 Make the size of SceneItem a PhysicalSize
... instead of two separate physical lengths
2022-02-18 10:39:16 +01:00
Simon Hausmann
dae68ae9d3 Use a PhysicalSize for the SceneTexture's source dimensions
... instead of two separate lengths.
2022-02-18 10:39:07 +01:00