Simon Hausmann
42a5a62fb5
Fix rendering of image elements without specified width/height
...
Fall back to the source image dimensions like the old renderer
2021-01-14 08:53:14 +01:00
Olivier Goffart
a069ceae7f
Fix warning with wasm
2021-01-14 08:53:14 +01:00
Olivier Goffart
44e279382f
Qt backend: fix tests
2021-01-14 08:53:14 +01:00
Olivier Goffart
21c2100f8d
Fix warnings
2021-01-14 08:53:14 +01:00
Olivier Goffart
2231711cf9
Qt text backend: draw the TextInput
2021-01-14 08:53:14 +01:00
Simon Hausmann
b79e4180c8
Rename trait Font
to trait FontMetrics
...
This name more closely resembles the functionality it provides.
2021-01-14 08:53:14 +01:00
Olivier Goffart
62150cba1a
Basic text input
2021-01-14 08:53:13 +01:00
Olivier Goffart
f396c1749f
Qt backend: Don't cache the font
...
Not necessary after all
2021-01-14 08:53:13 +01:00
Olivier Goffart
61e6e9cf74
Qt backend: Actually fix border drawing
2021-01-14 08:53:13 +01:00
Olivier Goffart
55da32c343
Qt backend: fix border rectangle of the checkbox in the slide puzzle
2021-01-14 08:53:13 +01:00
Olivier Goffart
705c3f6ec0
Qt Backend: enable anti-aliasing
2021-01-14 08:53:13 +01:00
Olivier Goffart
b0d89d5fd7
Qt backend: font cache
2021-01-14 08:53:13 +01:00
Olivier Goffart
12e954ad03
Qt backend: properly clear the cache
2021-01-14 08:53:13 +01:00
Olivier Goffart
00f165f6ed
Qt backend: cache images
2021-01-14 08:53:13 +01:00
Olivier Goffart
84c7b28256
Decouple the ItemRenderer from QPainter so it can hold a cache
2021-01-14 08:53:13 +01:00
Simon Hausmann
21bd79c1b7
Prospective C++ build fix
...
Include <memory> for std::unique_ptr
2021-01-14 08:53:13 +01:00
Olivier Goffart
0b20d13401
Qt backend: Implement register_application_font_from_memory
2021-01-14 08:53:13 +01:00
Olivier Goffart
e77872c775
Let Qt handle all the highdpi thing, and don't borther within SixtyFPS
...
This is less than ideal, because the phx unit has no meening anymore.
Eventually we will want to do that right
2021-01-14 08:53:13 +01:00
Olivier Goffart
754020d999
Qt backend: Popup menu
2021-01-14 08:53:13 +01:00
Simon Hausmann
3dba030243
Fix wasm build
...
This re-enables the wasm port through femtovg's wasm support. The Roboto
is included as a generic fallback font.
2021-01-14 08:53:13 +01:00
Olivier Goffart
10dffa7d79
Use the QPainter directly when using the Qt paint engine
2021-01-14 08:53:13 +01:00
Olivier Goffart
46dbb1ee9e
By default, enable the GL backend also on desktop
...
So it can be chosen with an env variable or if Qt is not available
2021-01-14 08:53:13 +01:00
Olivier Goffart
7bd1fb9ec8
Silence warning
2021-01-14 08:53:13 +01:00
Olivier Goffart
1ea522a7d0
Qt backend: Make the animation not take 100% CPU
2021-01-14 08:53:13 +01:00
Olivier Goffart
7dfc43977f
Qt backend: animations
2021-01-14 08:53:13 +01:00
Olivier Goffart
118d40d9e9
QtBackend: Timer
2021-01-14 08:53:13 +01:00
Olivier Goffart
7b4c600a4f
Fix compilation after rebase
2021-01-14 08:53:13 +01:00
Olivier Goffart
d4c357195d
Qt backend: make clicking on a TextInput not panic
2021-01-14 08:53:13 +01:00
Olivier Goffart
1eac260d99
Qt Backend: font size fixes
2021-01-14 08:53:13 +01:00
Olivier Goffart
d71bb9ab84
Qt backend: Image rendering
2021-01-14 08:53:13 +01:00
Olivier Goffart
49c9881d10
fix compile
2021-01-14 08:53:13 +01:00
Olivier Goffart
7d91651b48
Qt backend: input events
2021-01-14 08:53:13 +01:00
Olivier Goffart
4aa9faf532
Qt backend: border rectangle
2021-01-14 08:53:13 +01:00
Olivier Goffart
aeb67fa927
Qt backend: Resize event and layouting
2021-01-14 08:53:13 +01:00
Olivier Goffart
531ff42973
WIP: Qt backend using Qt
2021-01-14 08:53:13 +01:00
Simon Hausmann
1ed35fb628
Replace uses of FIELD_OFFSETS.foo.apply_pin(bar) with bar.foo()
2021-01-14 08:53:13 +01:00
Simon Hausmann
65dcb2cb33
Merge BuiltinItem and GeneratePropertyAccessors derive macros
...
... into the new SixtyFPSElement macro. This generates getters for all properties.
2021-01-14 08:53:13 +01:00
Olivier Goffart
9050c29305
Don't use the window through the eventloop module
2021-01-14 08:53:13 +01:00
Olivier Goffart
c7ff67d0fc
Move the ItemRenderer to the item_rendering module
2021-01-14 08:52:22 +01:00
Simon Hausmann
de4194c9ba
Make ItemRenderer take &mut again
...
It's cleaner and indeed possible
2021-01-14 08:52:22 +01:00
Olivier Goffart
16a1b7b2bd
Cache the pixmap in the native style
2021-01-14 08:52:22 +01:00
Simon Hausmann
43127cb059
Implement releasing of textures when items are destroyed
...
This means going back to an immutable renderer reference and interior
mutability for the canvas and the gpu cache. This is because while
traversing the item tree for rendering we may end up destroying
other items due to the lazyness of the models.
2021-01-14 08:52:22 +01:00
Olivier Goffart
b157648ab2
More work towards getting native widget with the femtovg backend
2021-01-14 08:52:22 +01:00
Olivier Goffart
f7c8d53e7a
Port the Qt Native item to the new API
...
this mostly restores code that was removed in commit 1a260b9dce13db38128f1f489633ba96f264d461
2021-01-14 08:52:22 +01:00
Olivier Goffart
4e9021b550
Use a type alias so that cbindgen generates the ItemVTable
2021-01-14 08:52:22 +01:00
Simon Hausmann
d92fe445d5
Remove the old GL renderer
...
and try to stub in the hooks to trigger the new one
2021-01-14 08:52:22 +01:00
Simon Hausmann
d4f603246c
WIP: Start a femtovg backend
2021-01-14 08:52:22 +01:00
Simon Hausmann
8dea0c88d1
Beginning of a different way of rendering items
...
This is the start of a different rendering abstraction, the result of a
separate discussion.
The objective is to provide a better backend encapsulation, that will
make it easier to implement other backends and let the backend decide
what to cache and what not. This is done by passing the struct with the
Property<> fields directly to the backend, so that it can decide what
the cache and what to use every time.
2021-01-14 08:52:22 +01:00
Olivier Goffart
8797f6512d
Rename Slider min/max property
...
For consistency with the SpinBox
Fixes https://github.com/sixtyfpsui/sixtyfps/issues/138
2020-12-30 10:02:38 +01:00
Olivier Goffart
56b67eac8c
Complete the last patch to add a minimum/maximum properties to the SpinBox
2020-12-29 09:44:19 +01:00