Commit graph

2013 commits

Author SHA1 Message Date
Lukas Jung
cea17c1958 Add mouse-cursor support to glwindow backend 2021-12-07 22:41:24 +01:00
Lukas Jung
87fe9fe836 Set the mouse-cursor when hovering a TouchArea 2021-12-07 22:41:24 +01:00
Lukas Jung
f0a47ff154 Add mouse-cursor property to TouchArea 2021-12-07 22:41:24 +01:00
Olivier Goffart
c964696e24 Bump winit version 2021-12-07 14:28:31 +01:00
Simon Hausmann
0a60cb1a66 Fix clipping optimiztion for box rectangles
The geometry of the box shadow element does not include the offset and
the blur. So our clipping may ignore the shadow when it shouldn't. This
could be changed by making geometry() return bounds that include the
blur and offset, but that in turn will add a visual offset when a
repeated rectangle has a shadow, because the shadow because the root of
the repeated element and the previous rectangle a child.

Fixes #713
2021-12-07 13:06:31 +01:00
Simon Hausmann
957186acb7 Fix drop shadow offset handling with the GL renderer
The cached shadow image should just be the cache of the shadow. This
removes a visible "edge" from the shadow sometimes and brings the
rendering in line with the Qt backend.
2021-12-07 13:06:31 +01:00
Olivier Goffart
9e1e7e3937 Qt backend: simplify the way we set the no-frame flag on the QWidget 2021-12-06 18:52:10 +01:00
Olivier Goffart
310bf897cd Native ComboBox: style the background of the popup
Fixes: #720
2021-12-06 18:52:10 +01:00
Olivier Goffart
2ffa83db0e Native Style: hover effect on NativeStandardListViewItem 2021-12-06 18:52:10 +01:00
Olivier Goffart
f27a2b8c74 Fix issues related to alias to globals
two problems
 - For the interpreter, properly handle the case of an alias to a global
 - For the rust generator, we can't return a reference to a property held
   in a global, so we must 'inline' the get_xx funciton on sub-components
2021-12-06 14:30:47 +01:00
Olivier Goffart
464ba195a8 Don't use deprecated API 2021-12-06 13:00:32 +01:00
Olivier Goffart
8b9be10ff8 Attempt to properly detect if the native style is available when cross compiling
... and using the sixtyfps! macro

The problem is that the OUT_DIR in the build script of the macro crate
is reporting a target directory for the host (since the macro itself is
built for the host), but we need to get the OUT_DIR of the crate, so query
it in the macro. Unfortunatelty, that env variable is only set when the
crate (using the macro) has a build script. So use a fallback to find the
target directory

Fixes #462
2021-12-06 12:59:48 +01:00
Olivier Goffart
cd47ef1100 Mark properties that we know are never modified as constant,
so that we don't need to register dependencies when accessing them
2021-12-04 22:00:12 +01:00
Olivier Goffart
a90013983b Add a way to debug the properties behind a configuration flag
I used a `#[cfg(..)]` instead of a feature flag because then it is enabled
for both the compiler and the lib at the same time, and since it is only a debug stuff
it does not need to be enabled within the project. So one must enable it with
`RUSTFLAGS='--cfg sixtyfps_debug_property'`
2021-12-04 22:00:12 +01:00
Olivier Goffart
ffe561f8d8 Use SharedVector internally in SharedString
Get rid of the triomphe dependency
2021-12-02 12:42:30 +01:00
Olivier Goffart
691d43d416 MCU backend: build with no_std 2021-11-30 21:33:32 +01:00
Simon Hausmann
6ca63aac9c Make it possible to delegate the timer handling to the backend
When building with no_std, the backend can provide the global
instant.
2021-11-30 17:27:55 +01:00
Olivier Goffart
6004c4ee2f Make the std feature optional in sixtyfps-rs
And tweak the MCU backend dependencie
2021-11-30 15:48:05 +01:00
Simon Hausmann
bf84bb2ab6 Make floating point operations compile with no_std
Use num_traits and libm instead, also for euclid.
2021-11-30 15:33:50 +01:00
Simon Hausmann
e8302452b5 Make it possible to compile sharedvector and sharedstring with atomic-polyfill 2021-11-30 15:32:47 +01:00
Simon Hausmann
855ef6375e Minor no_std build fix
Use core::time::Duration instead of std::time
2021-11-30 12:57:45 +01:00
Simon Hausmann
8f4b256da0 Fix components being inadvertendly shown when using Qt
Remove a spurious show() call, only an explicit show() should bring up the widget on the screen.
2021-11-30 12:31:51 +01:00
Olivier Goffart
5a5e87e3cb Even more fix to no_std thread_local 2021-11-30 09:52:14 +01:00
Olivier Goffart
9a7387e2a6 Another small fix for no_std 2021-11-30 09:38:33 +01:00
Olivier Goffart
4149563817 More fixes with no_std regarding statics and thread_locals 2021-11-30 09:33:39 +01:00
Olivier Goffart
e8271b8f1d Make corelib work without thread_local in no_std 2021-11-29 21:00:35 +01:00
Simon Hausmann
6233cc64f2 Fix build with Qt 5
The QPalette workaround is only needed for Qt 6.
2021-11-29 17:18:23 +01:00
Simon Hausmann
e512feb952 Fix reacting to palette changes when using Qt
Due to a bug in Qt's implicit sharing in QPalette, the resolve mask of
QGuiApplicationPrivate::app_pal would get changed with an unrelated setColor
call and thus break color resolution from a new base palette when the theme changes.
2021-11-29 17:18:23 +01:00
Olivier Goffart
e4bd6bbfb8 Native style: respond to the StyleChange event
So that color scheme is updated when switching to the dark style, for example

Fixes #687
2021-11-29 17:18:23 +01:00
Olivier Goffart
a5ea6dd087 Models: re-implement the internal of model tracking
Don't rely on the weak-table that does not work with no_std,
instead, use the same data structure as for the property dependency
tracking
2021-11-29 17:15:56 +01:00
Olivier Goffart
d335ef01c6 Fix sixtyfps-corelib tests when they are run standalone 2021-11-29 17:15:56 +01:00
Olivier Goffart
d8e4c6a887 Properties: Refactor the Dependency tracking in a module
So it will be re-used by the models
2021-11-29 17:15:56 +01:00
RustemB
baa5e53fe9 Cut text using Ctrl+x 2021-11-29 16:29:07 +01:00
Olivier Goffart
844c5cf7ec Gate the Path item behind the 'std' feature 2021-11-25 16:53:07 +01:00
Olivier Goffart
5b4d6e8ece Disable the default-features of a bunch of crates 2021-11-25 12:02:16 +01:00
Olivier Goffart
763065fd0e Disable the std feature from strum
also use its derive feature
2021-11-25 12:02:16 +01:00
Olivier Goffart
80c0602277 WIP: start making the corelib crate a no_std crate
Does not compile yet with no_std because of the lack of
alternative for thread_local
2021-11-25 12:02:16 +01:00
ogoffart
3278b39549 Bump version number to 0.1.6 2021-11-24 14:19:09 +00:00
Olivier Goffart
3e3e98725f Fix build
apparently there was Some issue while rebasing
2021-11-22 17:57:08 +01:00
Olivier Goffart
20f41a681b MCU: Render line by line in a line buffer 2021-11-22 17:15:28 +01:00
Simon Hausmann
2753186f3a Fix CI build
Comment out unused z field in the MCU renderer
2021-11-22 14:36:12 +01:00
Olivier Goffart
6a17ae3328 MCU: Dasic support for image drawing 2021-11-22 13:51:22 +01:00
Olivier Goffart
5c9c5c2748 WIP: work on the MCU rendering engine 2021-11-22 13:51:22 +01:00
Olivier Goffart
a40885b39e MCI: small changes required to run an (empty) windows for the compiled printerdemo 2021-11-19 16:03:38 +01:00
Olivier Goffart
d1cae710df preprocess the images at compile time
For the MCU port, we need to proccess the image to save them in the binary
in a convenient format.
This patch start this work by trying to anaylyze what format should an image
be using, and saving it as a texture in the binary.

The current graphical backend and the C++ frontend are not yet supported
2021-11-19 15:54:45 +01:00
Simon Hausmann
d539d4be79 Naive implementation of the window background item for the simulator 2021-11-19 15:02:52 +01:00
Simon Hausmann
abb423ed33 Initial commit for a new software rendering backend for use in MCUs
This adds the skeleton, including a winit driven simulator window
and a dummy ItemRenderer implementation.
2021-11-19 15:02:52 +01:00
Simon Hausmann
8f940a446e Make it possible to opt out of the default rendering backend selection
The default backend does not select any features or backends by default
on the Cargo.toml feature level. And with this change it also doesn't do
that anymore based on the target platform.

That means if the rust api crate is built with default-features = false,
no backend will be selected and the user has to take care of backend
initialization through other means.

The feature defaults, generally, are in the rust API crate, the
interpreter crate and C++ CMakeLists.txt. The latter triggers a cargo
build of sixtyfps-cpp with --no-default-features. However the cpp_test
job in the CI doesn't build sixtyfps-cpp with CMake but instead calls
cargo directly. Therefore the defaults are now also coded in the
sixtyfps-cpp Cargo.toml, to ensure that *a* rendering backend is chosen
(since the cfg.target bit is gone).
2021-11-19 15:02:52 +01:00
Olivier Goffart
f138887857 QPainter and QBrush are now exposed by qttypes 0.2.5 2021-11-19 12:43:47 +01:00
Olivier Goffart
6bf224c9de Bump version of strum 2021-11-18 11:16:24 +01:00