Olivier Goffart
1360f1e26e
Added icon property to the Window element
2021-07-20 16:34:19 +02:00
Simon Hausmann
68626e27fb
internal cleanup: simplify free_graphics_resources trait signature
...
This allows then routing the call through window::Window's Deref impl
2021-07-20 16:19:45 +02:00
Simon Hausmann
457ae53cde
qt renderer: Fix difference between font metrics and rendering
...
When the widget itself is part of a hierarchy and some parent widget defines
font properties (such as weight, etc.) that aren't defined in .60, we would
inherit those for rendering, but not when measuring.
Since when measuring we don't have a widget, this patch disables all font
property merging from the widget hierarchy.
2021-07-20 13:33:25 +02:00
Olivier Goffart
07c1504627
Ammend previous commit
...
The test for empty text in NativeButton was meant for the sizeHint call,
not the render call.
Also fix a warning about unused variable
2021-07-16 22:30:38 +02:00
Olivier Goffart
ee53866afb
Native style: fix sizing of the ComboBox
2021-07-16 22:15:51 +02:00
Olivier Goffart
13bd828b96
Update license date
2021-07-02 15:55:54 +02:00
Olivier Goffart
6ffe456fd8
Qt backend: use QChar::LineSeparator to split lines in a QTextLayout
...
That's better than re-layouting with setNumColumns
2021-06-30 13:33:19 +02:00
Olivier Goffart
5bbd4b1afb
Qt backend Text elision with word-wrap
2021-06-30 13:33:19 +02:00
Olivier Goffart
a58daa31c9
Fix popup size
2021-06-29 09:30:07 +02:00
Olivier Goffart
98cec35080
Increase version numbers
2021-06-28 10:39:43 +02:00
Tobias Hunger
13d7f5e7bd
Janitor: Fix typos in comments and user-facing strings
...
Also adapt tests for error messages containing the fixed strings.
No behavior change is intended!
2021-06-28 08:32:25 +02:00
Simon Hausmann
0fdb87cc69
Add Image::size()
...
This requires the image size query to be window independent and go
through the backend instead.
This implies minor changes for the Qt backend and bigger ones for the GL
backend:
* There exists now a thread-local IMAGE_CACHE, which is used by the
backend's image_size() function as well as by the renderer for
loading CPU side images.
* The image remain as decoded images in there (including SVG tree)
and the window now has a texture_cache, which holds CachedImage
with ImageData::Texture.
* Rendering an image item therefore fetches the CPU side image,
calls upload_to_gpu() on it, which creates a new Rc<CachedImage>
and that's stored in the texture_cache.
* The texture cache continues to be pruned when hiding the window.
2021-06-20 11:18:28 +02:00
Olivier Goffart
c1a144c282
Layout height for width for the Text
2021-06-17 11:23:58 +02:00
Olivier Goffart
ce37cd2552
Rename a function to avoid confusion with a field
2021-06-16 15:14:07 +02:00
Olivier Goffart
deaa0fddb0
WIP layout: split vertical and horizontal cache
...
Split the vertical and horizontal pass into different property cache
This will allow to implement "height for with"
This patch does not port the Rust or C++ binding yet
2021-06-16 15:14:07 +02:00
Simon Hausmann
5cad61bcd0
Fix disappearing text in vertical layouts with word-wrap and alignment
...
When a Text element has wrapping enabled, it should not have zero
minimum size. Otherwise the layout will give it a height of zero in the
layout in the test case and that'll make the text disappear. There are
different options but this patch goes for minimum height as if no
wrapping was enabled (so at least one line plus forced line breaks).
Fixes #246
2021-06-01 10:52:26 +02:00
Olivier Goffart
142a8dc185
Rename ImageReference to ImageInner and make Immage.0 private
2021-05-28 17:05:16 +02:00
Olivier Goffart
0b3fecf300
WIP: API to expose image loading from C++ and Rust
2021-05-28 17:05:16 +02:00
Olivier Goffart
4584c40544
Rename items::Image to ImageItem
...
Because there will be soon a sixtyfps::Image and the names
can't clash
2021-05-28 17:05:16 +02:00
Simon Hausmann
7ddbfbdd64
Clean up font_metrics interface on corelib: 🪟 :Window
...
Since the GL backend can't really fail on this anymore we can now
remove the Option from the return value.
2021-05-27 17:04:45 +02:00
Simon Hausmann
655aff24e4
Fix CI
...
Remove trailing whitespace to silence cargo fmt
2021-05-21 17:52:29 +02:00
Simon Hausmann
431c433e8b
Clean up blur effect C++ code
...
Use Olivier's advice and use the more modern using declaration to access
the draw function, locally.
2021-05-21 17:33:21 +02:00
Simon Hausmann
1d92ab4d36
Simplify Qt blur effect application slightly
...
Call draw on the blur effect directly instead of going through QGraphicsScene::render().
2021-05-21 17:33:21 +02:00
Simon Hausmann
27dcfa0f11
Improved rendering of drop shadow for Qt
...
Use QGraphicsBlurEffect as public API to take the blur into account
2021-05-21 17:33:21 +02:00
Olivier Goffart
1f46fd05ec
Allow the qt_viewer to compile if cmake finds qt, but not qttypes
...
This can happen when setting the SIXTYFPS_NO_QT env variable
cc #232
2021-05-21 07:45:38 +02:00
Olivier Goffart
7f117829f2
Display a warning if Qt is older than 5.15
...
cc #232
2021-05-20 18:28:52 +02:00
Simon Hausmann
235e102f31
Fix slide puzzle not showing with the Qt backend
...
The window in .60 in the slide puzzle has no preferred size set. Therefore fall back to QWidget::sizeHint().
2021-05-20 18:19:20 +02:00
Olivier Goffart
3983e47720
Fix initial window size
2021-05-18 16:55:07 +02:00
Olivier Goffart
fbdbe69fe7
Window: make hight and width fixed size, preferred-* property set the initial size
...
Issue #227
2021-05-18 10:23:06 +02:00
Olivier Goffart
987f4666b8
Fix Qt6 build
2021-05-14 14:02:43 +02:00
Simon Hausmann
5b9d64b26e
Fix failing assert in QFont with the printer demo
...
We use a weight of 900 in the demo, which results in a QFont::Weight of 100.
Unfortunately QFont::setWeight() doesn't cap itself, but brutally asserts
if the value is > 99. So let's cap ourselves.
2021-05-14 09:25:47 +02:00
Simon Hausmann
290759cf16
Fix Qt build
...
Amends ea358d9b2c
2021-05-12 22:06:39 +02:00
Olivier Goffart
7b2653db23
MouseWheel support for the Flickable
...
cc #222
2021-05-12 13:28:39 +02:00
Olivier Goffart
5f74475224
Refactor the MouseEvent
2021-05-12 12:03:03 +02:00
Olivier Goffart
720001a223
Remove the solve_layout from the component vtable
...
no longer required
2021-05-11 14:59:57 +02:00
Olivier Goffart
11158fa922
Remove implicit_size from the Item vtable
...
Use the preferred size in the layouting_info instead.
2021-05-11 14:59:57 +02:00
Olivier Goffart
81473c2541
Remove implicit_size from the Item vtable
...
Use the preferred size in the layouting_info instead.
2021-05-11 14:59:57 +02:00
Simon Hausmann
c84e6d2945
Export getter functions for all item vtable implementations
2021-05-10 22:54:06 +02:00
Olivier Goffart
a4b31fbe2e
CI: -W was not enough to override the -D, use -A instead
...
Also fix a warning about the usage of std::any::Any without dyn
2021-05-06 19:03:52 +02:00
Simon Hausmann
e3d031a5a4
Fix wasm build when Qt is found in the host system
...
Pull in qttypes only on non-wasm builds. This requires resolver = "2" as
well, but we require that anyway for wasm builds.
2021-04-27 15:43:05 +02:00
Olivier Goffart
0bb61cc1b3
Fix popup placmement and size with the qt backend
2021-04-26 17:29:06 +02:00
Olivier Goffart
3380383787
Bump version number
...
(Does not include docs and README yet)
2021-04-26 13:16:48 +02:00
Olivier Goffart
6fe2c1fa56
Prevent the maximum size to be set to 0,0
...
Otherwise the window will disapear and will never be seen again
This is a mitigation for #194
2021-04-23 13:10:53 +02:00
Olivier Goffart
9adf95c99f
Fix native widget with the GL backend and a scale factor
...
We need to keep everything in logical, but it most likely already it
2021-04-21 18:38:58 +02:00
Olivier Goffart
c2745c76ed
Use qttypes from crates.io since it has been released
2021-04-21 13:12:55 +02:00
Olivier Goffart
2e09a58fd7
Use the qttypes crate
2021-04-20 12:41:44 +02:00
Simon Hausmann
6d7f8b6bab
Fix handling of border width for clip in the GL backend
...
Similar to commit 48e6d2f48b
, share the rect adjustment
code between the rectangle drawing code and the clipping.
2021-04-15 15:43:49 +02:00
Olivier Goffart
3bf3761450
Implement the Opacity filter.
...
Notice that the GL implementation currently don't combine the opacity
2021-04-15 10:17:52 +02:00
Simon Hausmann
48e6d2f48b
Fix handling of non-zero border width in clip-enabled Rectangles
...
The border should be visible (as in the included test case), which this
patch fixes for Qt by subtracting the border width just like when drawing.
2021-04-14 13:34:51 +02:00
Simon Hausmann
47a255eea5
Further preparation for more aggressive font caching
...
Pass everything needed for delayed evaluation for
`PlatformWindow::font_metrics()` to permit caching the font matching
result in the Text/TextInput's rendering cache.
2021-04-13 15:30:33 +02:00