Commit graph

11987 commits

Author SHA1 Message Date
Arnold Loubriat
f01420258f Changelog: Introduce AccessibleRole::ListItem 2024-09-16 09:15:39 +02:00
Arnold Loubriat
54992477d8 Changelog: Fix AccessKit role mapping for AccessibleRole::List 2024-09-16 09:15:39 +02:00
crai0
a0e20a0b51
core: implement FromIterator for VecModel (#6140)
Closes #5879
2024-09-16 08:26:59 +02:00
Olivier Goffart
890e63d352 dial example: move the files one directory down
There is only one directory alled "ui", so there isn't really need to have
this level of directory.
This aligns with other demo that don't have any source files

Also rename appwindow.slint to dial.slint
2024-09-14 18:37:17 +02:00
Olivier Goffart
58db7cabc1 examples: Fix links in READMEs 2024-09-14 14:44:41 +02:00
Olivier Goffart
15b186818c Changelog updates 2024-09-14 09:48:20 +02:00
Olivier Goffart
c82ff11419 Adjust the nightly script to the fact that the cpp artifact are named differently 2024-09-14 09:04:03 +02:00
chenren
a7e74b0def docs: translation is not supported on Windows 2024-09-14 07:19:34 +02:00
Olivier Goffart
2405877591 CI: use "nightly" instead of the version in the filename of the C++ packages 2024-09-13 19:13:04 +02:00
Olivier Goffart
67b82230f7 Skia: fix mixing tiling and colorize
A colorized image is baked by a texture, which needs the context so that
the make_subset don't return None
2024-09-13 17:35:57 +02:00
Simon Hausmann
5bfdfaf6c3 linuxkms: bump more dependencies 2024-09-13 17:30:19 +02:00
Olivier Goffart
827975202c femtovg: Fix mixing tiling and coloring
We need to pass the REPEAT_* flags also when creating colorized tetures
2024-09-13 17:03:58 +02:00
Simon Hausmann
44f1602fd6 Update drm/gbm dependencies
Fixes #3669
2024-09-13 16:10:10 +02:00
Tobias Hunger
1697226fc1 live-preview: Use the entire screen when preferred-size of a UI is 0
Use the entire screen-space (minus borders) when the preferred size
of a UI is 0 and we are asking to reset to the preferred size.

I was reluctant to implement this before as I think it is surprising
to start with a huge size when the size info is most likely wrong...
People typically render outside the component's area in that case.

Now that we clip away anything that is not inside the UI area, I think
this is discoverable enough now: When resizing you will see the UI
getting clipped after all.

The big size also avoids confusion when nothing shows up :-)
2024-09-13 15:06:51 +02:00
Tobias Hunger
e0426353a8
live-preview: Improve icons in hide/show sidebar buttons (#6128) 2024-09-13 09:06:02 -04:00
Simon Hausmann
f410ff3eef macOs: Remove "About" entry from preview
It's not implemented and it panics in muda :)
2024-09-13 14:43:14 +02:00
Tobias Hunger
86f2e397c9
live-preview: Prettify group component (#6127) 2024-09-13 08:11:31 -04:00
szecket
0bdf44b12f live-preview: Prettify the statusbar 2024-09-13 13:51:31 +02:00
szecket
f79043c70b
live-preview: Prettify the HeaderView (#6117)
* live-preview: Polish the header-view

* live-preview: Clean up the previous patch a bit

---------

Co-authored-by: Tobias Hunger <tobias.hunger@slint.dev>
2024-09-13 23:14:09 +12:00
Tobias Hunger
0ae32b5a33 live-preview: Clip drawing outside of ComponentContainer
Clip anything the previewed UI wants to draw outside
of the area the previewed component claims to be using.

There are several reasons to do this:

 * A window will clip the contained component
 * Selection outside of the area taken up by the
   root component can not be selected or interacted
   with
 * It is more obvious that you are doing something
   wrong when your UI is clipped. Before we happily
   showed the right thing in the preview and then
   failed hard when using that component.
2024-09-13 12:11:49 +02:00
Olivier Goffart
10e7c83020 live-preview: don't set x and y When dropping an element
This means that, when the parent is not a layout, the widgets are
always dropped in the middle of the parent, and then one can place
place it to the right position.

In particular, for widget that expaneds to the size of their parent by
default, this does the right thing

Fixes #6098
2024-09-13 10:06:40 +02:00
Nigel Breslaw
b36a66e405
Enable more js/tsc biome rules
noUselessConstructor
useNodejsImportProtocol
noImplicitAnyLet
2024-09-13 10:04:39 +02:00
Tobias Hunger
eed03345b5 live-preview: Fix property editing
Whow, what a stupid mistake I had there!

Closes: #6097
2024-09-12 20:53:08 +02:00
Tobias Hunger
58472748c4 live-preview: Be more precise when resizing
... by specifying *which* of the set of geometries we
are based on.
2024-09-12 20:53:08 +02:00
tiaoxizhan
552eb56e5b chore: fix symbol error
Signed-off-by: tiaoxizhan <tiaoxizhan@outlook.com>
2024-09-12 20:26:01 +02:00
Olivier Goffart
f415893f4b
Nightly template: add instruction on how to use "nightly" slint (#6120) 2024-09-12 17:20:47 +02:00
Nigel Breslaw
2bee820ccf
Start to enable default javscript/typescript lint rules
This enables the recommended rules useConst and useImportType
2024-09-12 16:08:52 +02:00
Olivier Goffart
8d9c041aa4
dial demo: add links to online preview/editor 2024-09-12 15:50:55 +02:00
Nigel Breslaw
d6dd8343e3
Dial example
Shows off how to use some basic math to create an interactive dial and place visual elements around a circle dynamically.
2024-09-12 15:14:30 +02:00
Tobias Hunger
2bdacb7547 live-preview: Compile-test adding components
We did not have the compile-test infrastructure when
implementing the addition of new components into a UI. Use that
infrastructure, it catches some places where we can not actually
drop into that the previous heuristic missed.
2024-09-12 15:04:21 +02:00
Tobias Hunger
7323aa2641 slintpad: Biome fixes
Add configuration excluding generated JS files for biome in slintpad.

Let biome fix lints and format of everything.
2024-09-12 15:03:18 +02:00
Tobias Hunger
f1da741c8c vscode: Apply biome fixes
No manual change in this PR at all, just the result of
`npm run lint:fix`.
2024-09-12 15:03:04 +02:00
Tobias Hunger
b95f0e62c8 live-preview: Always unselect when clicking onto background
Always unseelct the currently selected item when clicking onto
the background around the previewed UI.
2024-09-12 13:53:39 +02:00
Simon Hausmann
d1c9d4e466 Minor tweak to framebuffer presentation error message in linuxkms backend
cc #4619
2024-09-12 13:50:30 +02:00
Simon Hausmann
2ccc468b27 Fix location of comment 2024-09-12 13:30:55 +02:00
Olivier Goffart
524360d306 live-preview: Hide "Timer" from the lcomponent library
Timer is not really a visual element and it doesn't really make sense
to put it on the library at this point
2024-09-12 13:29:36 +02:00
Olivier Goffart
e693257572 live-preview: round the x and y properties when dropping
Otherwise we end up with values such as

```slint
    SpinBox {
        minimum: 0;
        value: 42;
        maximum: 100;
        x: 94.44821px;
        y: 108.07013px;
    }
```

Which doesn't make much sense
2024-09-12 13:29:18 +02:00
Simon Hausmann
5825cb4f46 Use command instead of control for the status text when running on macOS 2024-09-12 12:48:34 +02:00
Simon Hausmann
9b154edb14 Node.js: Avoid building the nodejs bindings possibly twice
The driver should invoke `npm run build:testing` and that should be the only build of the .node plugin.
2024-09-12 12:46:26 +02:00
Simon Hausmann
a5007cd673 Node.js: Fix test-driver-nodejs crashing on Windows
With 1.81 the debug build crashes with what seems like an out of stack
exception (worked with 1.80). A release build works.

Fixes #6046
2024-09-12 09:57:50 +02:00
Olivier Goffart
3b6cc0f8cf Flickable: size in % bow refer to the Flickable's size instead of the viewport
This is consistant so that `width: 100%` is the same as `width: parent.width`

This basically revert the previous commit that was just working around
the debug_assert to actually fix the behavior

ChangeLog: width and height expressed in `%` unit for an element in a
Flickable now refer to the size of the Flickable instead of that of
the viewport
2024-09-12 09:45:24 +02:00
Olivier Goffart
e98780fafc Fix compiler panic when using % size in a flickable
The viewport of a flickable is of ElementType::Native, and `lookup_property`
don't query the builtin reserved properties in that case.

This commit fix the assert by allowing Type::Invalid as well.

Fixes #4163
2024-09-12 09:45:24 +02:00
Simon Hausmann
050aade489 CI: don't run the nightly tests when creating a release
This should be done before the release and the job that tries to download the binaries from the untagged release won't work anyway.
2024-09-12 09:12:17 +02:00
Simon Hausmann
4d43d02b03 esp-idf: Add support for using pre-built binaries
Run the nightly esp-idf test against the esp-idf slint nightly
binaries, after creating them. The snapshot is run earlier as well
then, so that the tests don't "leak" into the morning working hours.
2024-09-11 19:27:41 +02:00
Olivier Goffart
3bc758bc3f Janitor: deps update 2024-09-11 17:19:36 +02:00
Tobias Hunger
026e723029 live-preview: Add buttons to hide sidebars 2024-09-11 16:16:18 +02:00
Tobias Hunger
b01f0f926b live-preview: Add statusline with help text 2024-09-11 16:08:27 +02:00
Olivier Goffart
ea3a6e2087 Viewer: use Display to print the error message
For example, running the viewer with a DISPLAY wrongly set:

Before the patch:

```
thread 'main' panicked at tools/viewer/main.rs:123:32:
called `Result::unwrap()` on an `Err` value: Other("Could not initialize backend.\nError from Winit backend: Error initializing winit event loop: the requested operation is not supported by Winit\nError from LinuxKMS backend: Timeout while waiting to activate session\nNo backends configured.")
stack backtrace:
[...]
```

If just using `?` instead of `.unwrap()`:

```
Error: Other("Could not initialize backend.\nError from Winit backend: Error initializing winit event loop: the requested operation is not supported by Winit\nError from LinuxKMS backend: Timeout while waiting to activate session\nNo backends configured.")
```

If using an wrapper that uses Display for Debug

```
Error: Could not initialize backend.
Error from Winit backend: Error initializing winit event loop: the requested operation is not supported by Winit
Error from LinuxKMS backend: Timeout while waiting to activate session
No backends configured.
```
2024-09-11 15:25:35 +02:00
Tobias Hunger
f5667b4d2b live-preview: Clean up icon handling 2024-09-11 13:22:04 +02:00
Nigel Breslaw
a218c945ad
Use Biome across monorepo and for Slintpad (#6080)
Puts a shared biome.json in the root.
Deletes the prettier config files.
Deletes the unused pre-commit hooks.
Applies biome linting and formatting to the slintpad project.
2024-09-11 13:07:55 +02:00