Commit graph

8712 commits

Author SHA1 Message Date
Olivier Goffart
4845241ebf Rename translucent to transparentize and mixed to mix 2023-06-02 17:02:08 +02:00
Arthur Araruna
64ad1ce357 Add some color and brush manipulation funcs (#2565)
The added functions enable mixing colors and manipulating the opacity
of colors and brushes.

They enable the behavior of some of the available functions from SASS and are
added for future use for adding the Adwaita style (future PR).
2023-06-02 17:02:08 +02:00
Olivier Goffart
0c64312383 qt: fix rendering layers with a scale factor 2023-06-02 13:10:19 +02:00
Olivier Goffart
dafdc664bc Qt: make sure to apply antialiasing also when creating layers 2023-06-02 12:30:15 +02:00
Olivier Goffart
73162e0a69 CI: Attempt to run cargo about only for the given package 2023-06-02 10:06:50 +02:00
Simon Hausmann
cf1b53bf85 femtovg: Remove stray .or_else() in font fallback handling
query_with_family already handles the case when family is None, so we don't need to handle it twice.
2023-06-02 08:04:00 +02:00
Simon Hausmann
3ce80497e3 ffmpeg exampe: Remove erroneous output sample format condition
Amends 6ece192eec
2023-06-02 07:59:28 +02:00
Simon Hausmann
3d0c313357 Fix cargo-about
Add permissive WTFPL to list of accepted licenses
2023-06-02 07:57:52 +02:00
Simon Hausmann
59a45c6268
Fix markdown tables 2023-06-01 17:40:54 +02:00
Simon Hausmann
6ece192eec Add support for u8 as audio output format 2023-06-01 17:36:52 +02:00
Simon Hausmann
e5d4ec7713 Clean up the ffmpeg to cpal audio frame forwarding
Move the decoding and forwarding state into a struct, instead of keeping it in closure captures.
This way we can also make it generic over different output types.
2023-06-01 17:36:52 +02:00
Simon Hausmann
ced5803026 Add an example that shows how to combine ffmpeg with Slint
This is a minimal example, that can be used as basis to implement
hardware acceleration for video playback later.
2023-06-01 17:36:52 +02:00
Simon Hausmann
ada79d544c Fix on-demand previews in the documentation not showing up
After creating the winit window we end up issuing a request_redraw() on
the window adapter after setting the component. This is before show().
With regular windowing systems the redraw event will be delivered when
the window is actually shown, but winit delivers it right away.

In our draw() implementation we don't do anything before show() is
called, as the size won't be correct.

Therefore content is never rendered.

To work around this behavior, we can use the redraw_requested state and
draw right away in show() on wasm.
2023-06-01 16:51:12 +02:00
Simon Hausmann
a8fcb5acd6 Fix delayed docs preview not working
After commit 7df902b53c, the winit window
is not created when calling show() anymore but it's now created at
component creation time.  That means the event loop workaround removed
in 459f810bd8 is now needed at
construction time.

Since this is a winit and wasm specific issue, it's now dealt with in
the wasm interpreter implementation, by invoking the creation from the
event loop from there and returning a promise in the API.

This changes the API therefore: create() can only be called after the
event loop is running.
2023-06-01 16:51:12 +02:00
Simon Hausmann
c428601370
Add support for select-all(), cut(), copy() and paste() functions on text input elements (#2804)
In the compiler this is still very primitive, but an attempt to start a
generic interface. The basic assumption is that all item functions will
eventually need access to the window adapter and itemrc. Support for
additional arguments is still missing.

Also missing is support for the function access via rtti in the
interpreter, hence the hardcoding at the moment.
2023-06-01 16:04:53 +02:00
Simon Hausmann
d52f40979c Add ChangeLog entries 2023-06-01 15:56:55 +02:00
Simon Hausmann
e7320607a3 Remove BorrowedOpenGLTexture from the public API again and just provide a factory function in slint::Image 2023-06-01 15:56:55 +02:00
Simon Hausmann
ce20b43eb3 Remove unnecessary stencil buffer for C++ opengl texture import example 2023-06-01 15:56:55 +02:00
Simon Hausmann
11310bba4c Remove unnecessary allocation of a stencil buffer 2023-06-01 15:56:55 +02:00
Simon Hausmann
084ff70079 C++: Improve reliability of comparison operator of slint::Image
Call into the Rust implementation, so that we have to maintain only one
implementation.
2023-06-01 15:56:55 +02:00
Simon Hausmann
f51ca82f10 Add C++ API and example for borrowing OpenGL textures 2023-06-01 15:56:55 +02:00
Simon Hausmann
eadfec64a3 Add support for importing OpenGL textures into Slint
This is the initial API for Slint to borrow OpenGL textures from the
application for rendering.
2023-06-01 15:56:55 +02:00
Simon Hausmann
9d2cc6ee5e janitor: Fix typo 2023-06-01 14:46:44 +02:00
Simon Hausmann
4d61542dc3 Clean up debug info handling in the CI
Apply `CARGO_PROFILE_DEV_DEBUG: 0` consistently to all our builds.

Amends 4fa1f885a9
2023-06-01 12:54:38 +02:00
Simon Hausmann
e3e9131dc3
Fix panic when attempting to render window contents without a component (#2800)
With Qt and eglfs it may happen that when creating a popup, Qt delivers
a paint event via show() before we've had a chance to set the component
on the slint::Window. In that case unwrapping the component in
draw_contents() panics.

This fix is covered by reproducing the same scenario using public
MinimalSoftwareWindow API.

Fixes #2799

Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
2023-06-01 12:40:01 +02:00
Florian Blasius
0755af3b6d Change progress property of ProgressIndicator from in-out to out 2023-06-01 12:19:43 +02:00
Olivier Goffart
b634b1fa7f corrosion: update to beta2 2023-06-01 09:34:19 +02:00
Olivier Goffart
1036c0d082 c++: remove IMPORTED_NO_SONAME as corrosion sets it now 2023-06-01 09:34:19 +02:00
Olivier Goffart
9a103b9c37 Test beta version of corrosion 2023-06-01 09:34:19 +02:00
Florian Blasius
69a0d7e219 Fix some issues with material widgets in horizontal layouts 2023-05-31 20:13:38 +02:00
Simon Hausmann
6b8214c3f9 Add support for italic and bold text in the software renderer's bitmap font path
In the screenshot tests this works by setting SLINT_DEFAULT_FONT to
pointer to a directory, instead of a file. We then load all fonts in
that directory and consider their families the default unless a family
is specified. This way for "Noto Sans" a regular as well as an italic
version is registered in fontdb and returned in the list of font
fallback ids. embed_glyphs in the compiler then embeds those variants
and we find them at run-time.
2023-05-31 18:47:39 +02:00
Simon Hausmann
057493b3a9 Add support for italic text in the software renderer's vector font path
Centralize also fontdb::Query creation and family fallback handling in
sharedfontdb. This way SLINT_DEFAULT_FONT also works for the femtovg
renderer.
2023-05-31 18:47:39 +02:00
Simon Hausmann
3cf1b38a48 Add basic support for italic font face selection to Text and TextInput
This is implemented for FemtoVG, Skia, and Qt.
2023-05-31 18:47:39 +02:00
Simon Hausmann
439b0c09d8
Try to improve the documentation for ModelRc (#2791)
- Mention in the type mapping table as well as in ModelRc that ModelRc is also used for array struct fields.
- Use an itemized list for the different ways of constructing, with the from_slice variant being listed second.

cc #2787
2023-05-31 17:16:06 +02:00
Florian Blasius
52c4f2add9 Fix layout for material switch 2023-05-31 16:13:40 +02:00
Florian Blasius
b4472b9118
Added switch widget (#2798)
* Add material Switch

* Add fluent switch

* Add native Switch and cleanup

* Rebase fix

* Update internal/compiler/widgets/fluent-base/std-widgets-impl.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update examples/gallery/ui/pages/controls_page.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review tweak on gallery layout

* Code review tweak on gallery layout

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-05-31 14:57:23 +02:00
Simon Hausmann
590b011d0b Fix build with new cbindgen
Unfortunately the latest cbindgen release added private field to a
public struct, breaking our build. Work around this until
https://github.com/mozilla/cbindgen/issues/841 is fixed.
2023-05-31 13:35:03 +02:00
Florian Blasius
9e267bcc94
Add ProgressIndicator widgets (#2792)
* Add material ProgressIndicator and documentation

* Add fluent ProgressIndicator

* Add native ProgressIndicator

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update docs/language/src/builtins/widgets.md

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Code review

* Update internal/compiler/widgets/fluent-base/std-widgets-base.slint

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>

* Update changelog

---------

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2023-05-31 09:57:12 +02:00
Tobias Hunger
1eb8d2875b
Fix warnings in cargo doc output 2023-05-30 10:08:44 +02:00
Florian Blasius
edc60c8ece Add password char to embeded_glpyhs 2023-05-30 09:03:25 +02:00
Simon Hausmann
4fa1f885a9 Fix out of disk space errors in the CI on Windows
Disabling debug info reduces the amount of space in target from ~6GB down to ~4GB.
2023-05-26 19:25:48 +02:00
Simon Hausmann
8af017ed2d Bump FemtoVG
The latest release uses interior mutability for the Path caching.
2023-05-26 13:53:09 +02:00
Simon Hausmann
599d86e4e1 Simplify Skia renderer API
Remove the size argument from render().
2023-05-26 10:46:59 +02:00
Simon Hausmann
f9b8592eba Simplify FemtoVG Renderer API
Remove the size argument from render().
2023-05-26 10:46:59 +02:00
Simon Hausmann
879e09922f Begin renderer API cleanup: Remove size argument from WinitCompatibleRenderer::render()
We would pass `physical_size_to_slint(&self.winit_window().inner_size())`, which is
identical to `slint::Window::size()`, which
calls `size()` on the WindowAdapter, which
returns the above.
2023-05-26 10:46:59 +02:00
Simon Hausmann
b952b4e658 winit: Fix fullscreen support
This was accidentally removed in 7df902b53c

cc #2775
2023-05-25 19:07:21 +02:00
Simon Hausmann
dd61890e23 Fix rendering of the Qt platform example with high-dpi
- Provide a C++ platform event for the scale factor change and send it
- Report the correct logical and physical sizes to Slint
2023-05-25 05:29:52 +02:00
Simon Hausmann
459f810bd8 winit: Clean up implementation of WinitWindowAdapter::show() and hide()
show() used to create the window, which required access to the event
loop (target), which in turn required workarounds like in #1603.  Since
the winit window exists now in show(), we don't need this workaround
anymore.

The same applies to hide(), we don't need an event loop target, all we
need is the event loop proxy to dispatch a WindowHidden event.
2023-05-24 15:59:56 +02:00
Simon Hausmann
dd04e044d0 Fix build of C++ OpenGL underlay example
Test for the right feature flag and fix the compatibility feature names.
2023-05-23 17:26:45 +02:00
Simon Hausmann
e2180ea0f9 SixtyFPS -> Slint 2023-05-23 17:14:42 +02:00