Commit graph

10295 commits

Author SHA1 Message Date
Olivier Goffart
4920224be0
Rename Slider::vertical to Slider::orientation 2023-08-30 13:43:59 +02:00
Olivier Goffart
fde561a56a Some improvements to Window visibility
- From C++, always call the Window::show() and hide() function instead
   of going through set_visible directly as it doesn't set the size of
   the WindowItem
 - show() should also call resize on the renderer
 - remove the is_visible in the WindowAdapterInternal as it is no longer
   needed
2023-08-30 13:05:35 +02:00
Olivier Goffart
1721b2d1be Hide impl RendererSealed for SkiaRenderer
This is implementation details but it'd show in the docs
2023-08-30 12:45:09 +02:00
Tobias Hunger
d5cc147644 lsp: Use one common Error type (where possible) 2023-08-30 10:31:55 +02:00
Olivier Goffart
b1e1cd1881 wasm-interpreter: remove the highlight feature
We do the highlighting only from the LSP, even in wasm
2023-08-30 09:55:04 +02:00
Olivier Goffart
e46704465b C++: DEPFILE is supported on most generator in recent cmake versions 2023-08-30 09:54:03 +02:00
Olivier Goffart
de0836d1a0 C++: Fix ninja always rebuilding the .slint file
two bugs:
 - If the .slint file did not contain any import, the depfile would have
   no dependencies, and as a result, ninja would consider that it is
   always dirty.
 - In case the binary dir is a sub directory, the dependencies were
   relative to the wrong directory. Thgis is because the behavior
   changed in some version of cmake (see https://cmake.org/cmake/help/latest/policy/CMP0116.html)
   to avoid any problem, use the absolute paths

Fixes #3261
2023-08-30 09:54:03 +02:00
Olivier Goffart
4ad5b1f6d6 Remove the pin of nix 0.26.2 since nix 0.26.4 was released 2023-08-29 18:42:30 +02:00
Simon Hausmann
24df168f04
Make the FemtoVG renderer public in the Rust API (#3371) 2023-08-29 18:34:59 +02:00
Simon Hausmann
b11d2d957f Minor ChangeLog edits
Trailing commas, re-ordering to emphasize impact, etc.
2023-08-29 16:45:03 +02:00
Simon Hausmann
efb619b08a Revert "Make the SkiaRenderer public in the Rust API"
This reverts commit 9d27f0cc96.

This was not intended for the master branch. Ooops.
2023-08-29 08:55:26 +02:00
Simon Hausmann
9d27f0cc96 Make the SkiaRenderer public in the Rust API
It's also public in the C++ API and this is the equivalent change on the Rust API side.
2023-08-29 08:54:11 +02:00
Simon Hausmann
040019c7b6
doc: Fix link to set_physical_size 2023-08-29 07:02:31 +02:00
Olivier Goffart
9c3cba0c50 platform_qt example: implement clipboard 2023-08-28 21:21:53 +02:00
Simon Hausmann
d160eb7a31
Add support for set_position(), position(), and set_physical_size() to the C++ WindowAdapter (#3367)
Closes #3349
2023-08-28 18:43:04 +02:00
Olivier Goffart
d3b89df095 platform_qt example: fix closing the window
- QWindow::hide() don't terminate the application. QWindow::close() does.
- But QWindow::close() also recurse in the closeEvent, so we must
  prevent the recursion with m_visible

Fixes #3363
2023-08-28 18:06:15 +02:00
Simon Hausmann
42721c1853 Fix no_std build 2023-08-28 15:20:17 +02:00
Simon Hausmann
ce07a3ab74 Fix doc warning 2023-08-28 15:08:47 +02:00
Simon Hausmann
72ddbb2d4d Temporarily disable the Windows Rust tests in the CI
A recent MSVC update requires clang 16 when building with clang against the MSVC headers.
The Skia build compiles with clang and is thus affected.

This will be reverted once llvm16 becomes available on the GH runners.
2023-08-28 14:35:25 +02:00
Olivier Goffart
ded66231d1 C++: polish the clipboard patch
- make sure the Platform::Clipboard type is properly documented
 - Use the actual enum in the interface (even though it is
   #[non_exhaustive] so we need to slience a warning)

CC: #3265
2023-08-28 14:34:23 +02:00
Simon Hausmann
67423b288f Add documentation to the WindowAdapters to explain the basic message passing protocol
... and provide hints in there about implementing window close requests.

Note: The links to set_size() and set_position() are not resolved, as
these virtual functions are still missing from the WindowAdapter base
class.
2023-08-28 13:45:28 +02:00
Simon Hausmann
11128b3b7f Document show()/hide()'s behavior of the additional strong component reference 2023-08-28 13:45:28 +02:00
Simon Hausmann
a98e07417e Add support for a simple event loop with proxy to the testing backend
Moved from the spawn_local test, this allows for re-use in the
show_strongref integration test.
2023-08-28 13:45:28 +02:00
Simon Hausmann
de58d5e83c Keep the component alive when the window is visible
show() now let's Slint maintain a strong reference to the component, so
that it's easy to create new windows without having to do an awkward
dance around keeping the component alive.

Closes #3328
2023-08-28 13:45:28 +02:00
Tobias Hunger
4dda627d14 LSP: Move code around
No behavior should change in this patch!

Move all the code directly related to the LSP into a `language` module,
with `server_loop.rs` becoming `language.rs`, managing that module.

All the preview related code is moved into `preview`, with `preview.rs`
basically forwarding to `native.rs` and `wasm.rs`.

Code accessed from both `language` and `preview` stayed where it was.
2023-08-28 13:34:35 +02:00
Simon Hausmann
65f9e6f1eb Move the OpenGLInterface back to the FemtoVG renderer
At the moment it's only needed there, so let's
have it there and move it to core later if the need arises.
2023-08-28 13:33:15 +02:00
Simon Hausmann
48063f0df8 Fix Skia OpenGL/Vulkan feature selection
With C++, we would not forward the opengl/vulkan flags to the skia renderer, so
selecting no backend but just the SKIA_RENDERER_OPENGL would end
up merely selecting Skia, not activating the opengl feature.

The renderer features will continue to be delegated to the backend
selector crate, where they will be activated directly in the renderer.
2023-08-28 13:22:33 +02:00
Ian McFarlane
1de7b1512c
Expose clipboard_text accessors to C++ (#3265) 2023-08-28 12:26:40 +02:00
Olivier Goffart
93a8f604a8 linuxkms: update dependencies 2023-08-28 12:04:34 +02:00
Olivier Goffart
d7df345d27 CI: more prospective fix for the nightlies
Ammend previous commit
2023-08-27 14:48:39 +02:00
Olivier Goffart
c9b408da56 CI: upload wasm interpreter
ammand previous commit which restored the build of the wasm-interpreter, but forgot
to upload it as artifact

Reverts part of ba2c1cbfca to do so
2023-08-26 12:35:04 +02:00
Olivier Goffart
340e06dfb8 CI: build the wasm interpreter
The merge of the wasm preview inside the wasm lsp blob had the unintentional
consequence to stop the wasm interpreter from being built at all (since it
used to be build from the slintpad package.json command), but we still need
it for the doc preview and co.

Build it as it used to be build long before (before commit d506c9d553)
using a direct call to wasm-pack
2023-08-26 12:13:16 +02:00
Olivier Goffart
d23ba885ca
C++: add WindowAdaptor::update_window_properties 2023-08-25 13:58:55 +02:00
Simon Hausmann
e7a883348b Add links from Rust and C++ to the common platform backend docs
... and adjust the C++ platform backend docs a little to the current
state.

cc #3208
2023-08-25 13:22:06 +02:00
Tobias Hunger
acfa07594c vscode: Use the new LSP/Previewer WASM bundle 2023-08-25 13:19:34 +02:00
Tobias Hunger
ba2c1cbfca slintpad: Use the new LSP/Previewer WASM bundle 2023-08-25 13:19:34 +02:00
Tobias Hunger
cbd5afdeda lsp: Glue the wasm-interpreter onto the LSP
This way we can ship only the LSP as a WASM bundle in Slintpad and
VSCode, reducing the overall size a bit.

So far this just takes the code and API of the wasm-interpreter and puts
it into the LSP: Integrating that properly is not done yet.
2023-08-25 13:19:34 +02:00
Olivier Goffart
5052aa8561 Remove clap dependency of cbindgen
we don't use it, and clap used by cbindgen is an old version resulting
in duplicate clap versions being built
2023-08-25 10:51:59 +02:00
Tobias Hunger
bd3219f4e6 lsp: Remove maybe_goto_preview
Editors should support code actions nowadays.
2023-08-25 10:47:15 +02:00
Olivier Goffart
8a563e3570 Prospective CI fix 2023-08-25 10:37:15 +02:00
Olivier Goffart
f8e731ab70 Fix material ComboBox height in layout
It specified a height: 100% which set the layout info to have a
`min_percent: 100.0` which bubbles on other layout.
Arguably that's a bug in layouts but this 100% shouldn't be there.
CC: #3346
2023-08-25 09:57:06 +02:00
Simon Hausmann
5182660bc6 Initial draft for backend documentation
cc #3208
2023-08-24 19:34:08 +02:00
Olivier Goffart
7904493e1c C++: dispatch close request and activation change 2023-08-24 17:27:04 +02:00
Tobias Hunger
b35ccfcc77 lsp: Do not pass around a CompilerConfiguration
... when we only want the style and include_paths.
2023-08-24 17:14:54 +02:00
Tobias Hunger
3a1e077d18 lsp: Make the LSP part talk to the Preview part via the PreviewApi only
This should make it simpler to actually unify the WASM binaries of the
previewer and the LSP in an extra step.

Turn the PreviewApi into a trait object for easier use and
documentation.
2023-08-24 17:14:54 +02:00
Tobias Hunger
89a2e34c9e lsp: Extract some types out into a new common location
These are types I want to use to separate the previewer and the LSP part
more cleanly going forward.
2023-08-24 17:14:54 +02:00
Tobias Hunger
2bbefddd8d lsp: Fix build without preview feature 2023-08-24 17:14:54 +02:00
Tobias Hunger
3d8b6a8cfe lsp: Remove PorgressReporter
A cool bit of functionality, but no longer used... let's remove it.
2023-08-24 17:14:54 +02:00
Olivier Goffart
725a259e3a
C++: move the window related stuff in its own header (#3339)
slint.h starts to be quite big, and lots of it is because of Window, so
move Window to its own header
2023-08-24 15:51:50 +02:00
Olivier Goffart
c33e5a0f12
Rust platform API: add ways to send CloseRequested and WindowActiveChanged events 2023-08-24 14:39:20 +02:00