Commit graph

10295 commits

Author SHA1 Message Date
Tobias Hunger
4310969b2a wasm preview ui: Implement highlight from editor 2023-11-03 22:14:20 +01:00
Tobias Hunger
7d4a73b76c lsp: Make wasm and native previews work
Move code from the native side up into preview.rs as much as possible so
that both previews share as much code as possible.
2023-11-03 22:14:20 +01:00
Tobias Hunger
ec1698123f lsp: Extract the ServerNotifier from the previewer's ContentCache
That way I can reuse the rest of the ContentCache more easily.
2023-11-03 22:14:20 +01:00
Tobias Hunger
adb11e9866 lsp: Extract state reporting back to the LSP from native preview
Extract the code that reports back state to the LSP into stand-alone
functions for the native Preview implementation.
2023-11-03 22:14:20 +01:00
Tobias Hunger
2aac47b3c6 Change communication of slintpad with Preview
... to route it through the LSP, so that we can have a unified approach
to interact with the Preview UI.
2023-11-03 22:14:20 +01:00
Tobias Hunger
55cc1ae31f lsp: Remove the PostLoadBehavior
We always update if we have a UI and we never update if not. So this
flag does not help.
2023-11-03 22:14:20 +01:00
Tobias Hunger
df86bf67af lsp: Handle preview window getting closed in native LSP 2023-11-03 22:14:20 +01:00
Tobias Hunger
a0cc85bfb4 LSP: Remove design mode custom commands 2023-11-03 22:14:20 +01:00
Tobias Hunger
97f3046dbd LSP: Simplify the handling of ServerNotifier in the Previewer
The Preview delays starting the event loop as much as possible, simply
because our backends may panic/crash when they are not happy with the
UI configuration state they get started in.

So keep this... but use the `sender` in the Cache as an indicator of "we
have a UI". So explicitly set/reset the sender as the UI comes and goes
and do less implicit setup otherwise.
2023-11-03 22:14:20 +01:00
Tobias Hunger
55d0f5d473 lsp: Make native UI work
The UI is ugly and does not include the Design Mode button yet, but it
is a bit of progress.
2023-11-03 22:14:20 +01:00
Tobias Hunger
87c65ec536 core: Add some small helpers to ItemRc
So that it becomes a bit easier to work on with things that should not
cross certain component boundaries (like `ComponentContainer`)
2023-11-03 22:14:20 +01:00
Olivier Goffart
19954d39ac Call set_resizable before setting the constraints
Not sure why, but it fixes that applying the constraints is otherwise
not working with winit on X11

This is not the first time we do this fix:
723f89d342 and 1891e4489a
2023-11-03 18:51:49 +01:00
Simon Hausmann
ed570053a9 Fix copy & paste in wasm builds
Commit f24014a2dd made the insert function
private. Let's solve this differently by creating a private WASM
clipboard and invoking copy() and paste() on the Text item instead.

The first attempt was implementing a ClipboardProvider just for the wasm
build, just like with SilentClipboard, but unfortunately that doesn't
work because in the backend's set_clipboard_text()/clipboard_text()
functions, there's no currently running winit event loop that we could
access, becaused the call stack starts directly at the DOM event
handler, not in our winit event handler.
2023-11-03 17:36:58 +01:00
Simon Hausmann
bc14ce66c2 Fix resizing of windows on Wayland
On wayland, we may not be getting a resize event, after issuing `request_inner_size()`.
Without that, we would fail to size the EGL surface correctly.

Centralize all request_inner_size() call sites
and dispatch a "local" resize event if the new size is returned by winit.

Fixes #1671
2023-11-03 16:33:21 +01:00
Olivier Goffart
0efd2fd2a4 janitor: code formating 2023-11-03 15:43:29 +01:00
Olivier Goffart
a499e04b92
Update ci.yaml: prospective warning fix about missing key 2023-11-03 15:13:36 +01:00
Olivier Goffart
f043234890 C++: fix (private) properties of type EasingCurve
tests/cases/properties/animation_props_depends.slint in previous commit
added a property<easing> and that didn't work with C++
2023-11-03 15:11:06 +01:00
Olivier Goffart
89c80f3b6d Fix animation expression not being visited for use count of property
resulting in properties being optimized when they shouldn't
2023-11-03 15:11:06 +01:00
Olivier Goffart
c70f203157 Easing: add changelog entry and remove rectangle with hardcoded background in gallery 2023-11-03 09:27:03 +01:00
Ken Carpenter
b20536131f
Add more easing formulas (#3812)
Closes #2655
2023-11-03 09:20:44 +01:00
Update Translations Bot
01f8307160 Update Translations: extract strings 2023-11-03 03:04:48 +00:00
Olivier Goffart
589ab56643 Test android in the CI 2023-11-02 18:25:41 +01:00
Olivier Goffart
f03507ee6a Fix CI build: intra links don't work on non-android in the android backend 2023-11-02 17:53:57 +01:00
Olivier Goffart
45d6cd1f7f
Android: add readme for the backend (#3836)
To serve as docs while the backend is still internal

Co-authored-by: Simon Hausmann <simon.hausmann@slint.dev>
2023-11-02 17:17:06 +01:00
Olivier Goffart
fd35e24566 Disable FemtoVG on Android
Causes compilation problem with default features otherwise

And doesn't work anyway
2023-11-02 17:06:25 +01:00
Tobias Hunger
c2056075c0 janitor: Disable clippy::overly_complex_bool_expr in generated rust code
This makes clippy error out in our users code (using a nightly compiler).
2023-11-02 16:33:19 +01:00
Simon Hausmann
b925460635 gallery: Remove SpinBox from group box title
Commit 7784e37928 removed the widget, but the
title was not adjusted.

The SpinBox is in the separate section below.
2023-11-02 15:16:02 +01:00
Olivier Goffart
8c34bf6096 Crater: fix the path of some repo 2023-11-02 14:18:41 +01:00
Olivier Goffart
5f36eaca9a Android: handle InputEvent::TextEvent 2023-11-02 12:16:40 +01:00
Olivier Goffart
243b44d424 Fix C++ after refactoring of the KeyEvent 2023-11-02 12:16:40 +01:00
Olivier Goffart
de86c6049c Adapt wasm to the latest changes 2023-11-02 12:16:40 +01:00
Olivier Goffart
f24014a2dd Refactor the internal IME event
Base the info on what's discussed in #3811
but this is just the internal event and not the public API
2023-11-02 12:16:40 +01:00
Olivier Goffart
1efd83621d Refactor: Merge KeyInputEvent and KeyEvent
Both structure are bascially the same and only used internally, no need
to have the two.

The only difference was that one had the modifiers and the other one
not. But we can just set the modifier at the point we were converting
between the two.
2023-11-02 12:16:40 +01:00
Olivier Goffart
bebec49398 Refactor input_method_request
Part of #3811

But this is still on the internal trait for now
2023-11-02 12:16:40 +01:00
Olivier Goffart
1864257f29 Silence error when rendering SVG in an 0x0 size
Make the size argument to svg::render optional to mean that it is the
default size of the image.
Otherwise, passing None as the size to ImageInner::render_to_buffer
would not render the image which is possible in some backend (eg: the
button image icon with the qt backend)

And if the image is really rendered on an empty because of layouting or
so, we don't need to show a warning anyway.

Fix #3790
2023-11-02 11:09:20 +01:00
Florian Blasius
4ec63a9c71
cleanup examples according to upcoming code guidelines (#3809) 2023-11-02 11:04:40 +01:00
Florian Blasius
e3dbefafa5
node: implement access for globals (#3815) 2023-11-02 11:01:40 +01:00
Tobias Hunger
d62c98d574 janitor: Do not spam the build output with empty lines 2023-11-02 10:17:59 +01:00
Tobias Hunger
2adc3713fa janitor: Do not warn about unused imports in generated rust code
When testing, we have `deny(wanrings)` set, so this actully makes the
tests error out.
2023-11-02 10:17:59 +01:00
Tobias Hunger
2def4d2495 janitor: Suppress warning about unused native_widgets module
The module is empty when Qt is not around, which triggers a warning in
the nightly compiler.
2023-11-02 10:17:59 +01:00
Tobias Hunger
b5c433dada janitor: Fix build warning about DefaultParser 2023-11-02 10:17:59 +01:00
Simon Hausmann
1e579eeb4e Make it possible to focus Cupertino and Fluent buttons
The Material button already has the forward-focus.
2023-11-02 07:24:42 +01:00
Aurindam Jana
50a6040c38
Update cpp docs on installing or building slint (#3821) 2023-11-01 19:10:04 +01:00
Tobias Hunger
85b4f2cf29 component_container: Add basic tests for component container sizes 2023-11-01 17:25:42 +01:00
Tobias Hunger
83e37f7c51 component_container: Do not auto-match the parent's size
This fixes the widget having the right size and sifes some strange
issues I had been wondering about for a while now!

Pass own size to children instead, so that they will always have
matching sizes.
2023-11-01 17:25:42 +01:00
Simon Hausmann
24fecd247c Fix inactive accessiblity support in slint-viewer
slint-viewer should enable accessiblity by default.
2023-11-01 17:21:50 +01:00
Olivier Goffart
d828663c47 Crater: Update some URL
Disable outdated projects that never compiled
But keep the ones that don't compile and are updated in the hope that
they fix it
Also keep the ones that are failling because missing icon because there
was regressions in one of this project (#3823)
Add project from the github network that have stars and have non-trivial
use of slint
2023-11-01 11:31:09 +01:00
Olivier Goffart
ac8fd60091 Fix regression with empty array
Regression noticed in this line:
3f97d98bff/ui/tabs/downloads.slint (L77)

The following used to work:

```slint
import { Button, VerticalBox } from "std-widgets.slint";
export component Demo {
    in property <[int]> mods;
    VerticalBox {
        alignment: start;
        for xxx in true ? mods : [] : HorizontalLayout { alignment: center; Button { text: "OK!"; } }
    }
}
```

But we fixed array conversion and this caused a regression with empty
array
2023-11-01 11:30:59 +01:00
Simon Hausmann
2176523e4f Add support for nightly tagged releases on npm and smoke testing 2023-11-01 11:05:33 +01:00
Simon Hausmann
50c4d23526 Make it possible to build installable node packages
When creating an npm package, substitute workspace fields, so that the resulting Cargo.toml
can actually be used.

Also added a --git=sha1 option to generate snapshot-friendly
packages that add `git = ...; rev = ...`
for all slint dependencies.

This revers the previously added publish step, this doesn't have to be
in the xtask.
2023-11-01 11:05:33 +01:00