Commit graph

7643 commits

Author SHA1 Message Date
Simon Hausmann
66871da47b doc: remove stray triple slash 2022-11-24 09:15:05 +01:00
Tobias Hunger
1a0e0bcfaa vscode: Update version requirements
I just noticed that I had broken the package build before by updating
the types downloaded for vscode. Those types need to be in sync with
the vscode engine version!

Hard-code both to 1.70 for now, I think that is old enough to cover most
installaions of VSCode (which tend to be very new in my experience).
2022-11-23 18:46:42 +01:00
Simon Hausmann
fcd59fb0c1 Fix debug build of the gallery on Windows with Fluent style
The object file became too big, so
add /bigobj to the command line as
recommended by MSVC itself. Same as commit c6ec1e644a.
2022-11-23 17:18:52 +01:00
Simon Hausmann
f0d7009133 Fix C++ Ninja build on Windows
For Ninja builds we instruct the compiler to generate a dependency file.
This would include paths like builtin:/native/../common/slint-logo-light.svg,
which my version of Ninja on Windows doesn't like at all and just flat out aborts on.

It doesn't make sense for us to emit those as dependencies, so this patch excludes
builtin paths.
2022-11-23 17:18:52 +01:00
Florian Blasius
0b66628fc4
md: add ripple effect (#1892)
* Add `StateLayer` component
* Add `Ripple` component (used by StateLayer)
* use `StateLayer` in material `Button`
* use `StateLayer` in material `Item`
2022-11-23 17:03:46 +01:00
Tobias Hunger
784ea30bc7
Revert "build fix: Undo spelling fix, typo is upstream"
This reverts commit 2d8fa43c74.
2022-11-23 16:03:14 +01:00
Tobias Hunger
2d8fa43c74
build fix: Undo spelling fix, typo is upstream 2022-11-23 15:32:22 +01:00
Tobias Hunger
47300a7495
janitor: Fix clippy errors (#1895)
* janitor: Fix clippy error drop_copy

Clippy says cache_entry is Copy, so calling drop on it is useless since
it will drop a copied value.

* janitor: Fix clippy error

... about cloning a double ref.

Co-authored-by: Olivier Goffart <olivier@woboq.com>
2022-11-23 15:06:07 +01:00
Tobias Hunger
f8a0cf6d81 tools: Use setBinding in the LSP to set bindings 2022-11-23 14:03:44 +01:00
Tobias Hunger
bf340f62c1 tools: Make properties view use document version 2022-11-23 14:03:44 +01:00
Tobias Hunger
40ec6953a3 vscode: Update packages.json to make eslint work again
The version in there was too old of the typescript compiler I am using.
2022-11-23 14:03:44 +01:00
Tobias Hunger
9321b2acc0 online editor: Update Properties on position change
... which includes the document service for a couple of commits now.

This improves the update, decouples the properties from the editor
widget and makes the proerties widget more similar to the outline
widget.
2022-11-23 14:03:44 +01:00
Tobias Hunger
2837e6f971 online editor: Make the outline widget look at document version
Make the outline widget look at the version information and update as
necessary instead of every couple of seconds.
2022-11-23 14:03:44 +01:00
Tobias Hunger
e3f70cf714 online editor: Make the editor report document versions
This can be used to detect whether or not the data is outdated later.
2022-11-23 14:03:44 +01:00
Olivier Goffart
609b6d3a60
Use in/out/in-out in our styles 2022-11-23 13:41:28 +01:00
Tobias Hunger
f54c2d188b LSP: Cleanup error handling 2022-11-23 13:19:07 +01:00
Tobias Hunger
86f6636815 LSP: Drop document_cache handle before sending more requests
This works around the setBinding calling back into the client, which
would cause the LSP to panic as there already was a mutable reference to
the document cahce held.
2022-11-23 13:19:07 +01:00
Tobias Hunger
47e58e3f48 online editor: Use LspPosition/Range consistently
I was using the editor positions/ranges before, but converting between
LSP and editor values requires having the text at hand as we need to map
from utf-8 to utf-16 based numbering.

This forced all the LSP operations to happen in the editor itself, and
the editor exposing interfaces for the other parts of the online editor
to use. I plan to de-emphasize the editor for the LSP going forward, so I
need to switch out the addressing being used.
2022-11-23 08:44:04 +01:00
Tobias Hunger
195885e739 online editor: Add conversion from editor position to Lsp
Not used yet, but will be soon:-)
2022-11-23 08:44:04 +01:00
Tobias Hunger
df894bc127 online editor: Improve lsp position to editor position conversion
Make it accept null and undefined to make it easier to use.
2022-11-23 08:44:04 +01:00
Olivier Goffart
0714a9f6c6 Prospective fix for nightly build 2022-11-23 07:40:28 +01:00
Simon Hausmann
883e3c472e Fix Material Design's choice of default font
* Apply the "Roboto" family by default to the Window.
* Don't use "Roboto XXX" as that is not the name that's encoded as family name in the TrueType fonts. The variants should be chose based on the weight, not the family name.
* Don't apply the font family in the MD's LineEdit - that should not be necessary anymore.
2022-11-22 20:20:53 +01:00
Simon Hausmann
bddbd43fac Apply the default-font-family from the Style's StyleMetrics if available
This allows the style to provide a default font family.
2022-11-22 20:20:53 +01:00
Simon Hausmann
bff102a12e Fix use the meta key causing characters to appear in TextInput elements
This was a regression from 61c39b5fa1. We
now send key events also for keys that change the modifier state. Our
existing encoding uses characters in the control character category, so
the existing code in TextInput ignores them correctly. However for meta
we were using LATIN SMALL LETTER A WITH GRAVE, which is not CC category.

Deviate from the Mozilla encoding here, as there's little value to it
and there's much value to not showing the character and using the same
existing code for exclusion.
2022-11-22 20:16:52 +01:00
Simon Hausmann
1f2361f792 Remove stray debug output 2022-11-22 20:16:52 +01:00
Olivier Goffart
73a16a171c Janitor: upgrade a few crates 2022-11-22 18:38:05 +01:00
Simon Hausmann
fd64060b26
Fix placeholder text rendered on top of cursor when empty LineEdit is focused (#1888)
Render the placeholder underneath.
2022-11-22 17:51:41 +01:00
Olivier Goffart
2f07caf7d1 CI: add some examples to the list of things to be tested by the interpreter 2022-11-22 17:09:25 +01:00
Olivier Goffart
a1f7115ca4 Fix the fancy demo because of its use of @children
Commit 53090ab489 forbid the use of
@children in repeater and conditional elements because it can cause
problem in the cases where the element is referenced (which is not the
case in the fancy demo)

We could try to still allow this case, but it is easier to just fix the
demo.
2022-11-22 17:09:25 +01:00
Olivier Goffart
395532cebd Forbid former transitions declaration with the new syntax 2022-11-22 15:16:54 +01:00
Olivier Goffart
fc4abba9db syntax_updater: move to the new syntax for the transitions 2022-11-22 15:16:54 +01:00
Olivier Goffart
1ad6523960 Error message wording: remove the "TODO" 2022-11-22 15:16:54 +01:00
Olivier Goffart
51933b99bb New syntax for transitions, within the state 2022-11-22 15:16:54 +01:00
Tobias Hunger
11a5c2e3a9 vscode: Fix warnings
Fix warnings raised in the editor.
2022-11-22 12:47:43 +01:00
Tobias Hunger
aa47ef8a55 vscode: Delay registration of client
This avoids errors when the user starts to interact with our widgets
before the LSP is fully up.
2022-11-22 12:47:43 +01:00
Tobias Hunger
5e786e3486 vscode: Split up scripts in package.json
Handle the LSP/interpreter building in vscode:pre-publish instead of
compile to speed up compilation loops.
2022-11-22 12:47:43 +01:00
Tobias Hunger
2a351c1727 Reformat vscode 2022-11-22 11:32:17 +01:00
Olivier Goffart
f6a41e236a Fix typo 2022-11-22 06:26:25 +01:00
Olivier Goffart
c1c52a2b86 Make the test pass without defining the SLINT_EXPERIMENTAL_SYNTAX env variable 2022-11-21 22:01:52 +01:00
Olivier Goffart
022f58cb12 Some changelog updates 2022-11-21 18:55:21 +01:00
Olivier Goffart
d2ade4fd98
Document and enable the in / out keywords with the old component syntax (#1879)
But it still defaults to `in-out`
2022-11-21 18:41:35 +01:00
Simon Hausmann
59d3a69688
Fix support for multiple import statements from the same path (#1868)
Importing multiple types from the same file with multiple import statements would produce an error.
2022-11-21 15:37:38 +01:00
Simon Hausmann
809255ea56 Remove the hard-coded USB port from the sample command line
This way the command line can be copied and pasted into a terminal, even
when the USB port differs (for example on macOS). Instead, this now
defaults to a command line that makes espflash prompt, but the added
text explains how to shortcut that.
2022-11-21 15:29:49 +01:00
Simon Hausmann
9c7cb54b34 mcu: Add support for the ESP32-S3 box
This is a work-in-progress.

Similar to the S2 Kaluga board, this provides the basic support for
showing pixels on the screen of the S3 Box. There is no support for
touch input yet, or any of the button peripherals. There is also a bug
somewhere that causes the printerdemo_mcu to raise an uncaught
exception. Only a content-reduced version of the printer demo shows on
the screen.
2022-11-21 15:29:49 +01:00
Simon Hausmann
f3b3519278 Fix typo 2022-11-21 15:29:49 +01:00
Florian Blasius
00bd4909e1
SoftwareRenderer: render texture with opacity and color alpha channel (#1877)
* swr: add alpha field to texture
2022-11-21 15:26:35 +01:00
Tobias Hunger
edd4e81033 lsp: Add setBinding custom command 2022-11-21 15:01:09 +01:00
Tobias Hunger
a4e070bdfd compiler: Add support for handling binding expressions for the LSP 2022-11-21 15:01:09 +01:00
Olivier Goffart
2523a6b74c lsp: Make the LSP async 2022-11-21 09:13:21 +01:00
Tobias Hunger
ba4a7106b8
Update and reformat .pre-commit config
The prettier configuration has changed, this is now applied to the
pre-commit configuration.

Also make cspell ignore oxipng.
2022-11-20 15:20:14 +01:00