Commit graph

7334 commits

Author SHA1 Message Date
Florian Blasius
a4313c3e32
API changes for SortModel and FilterModel (rust and cpp) (#1768)
* Rust SortModel: Rename parameter `S` to `F`
* Rust SortModel: Rename parameter `apply_sorting` to `reset`
* Rust FilterModel: Rename parameter `apply_filter` to `reset`
* C++ SortModel: Rename parameter `sort_fn` to `comp`
* C++ SortModel: Add pub reset function
* C++ FilterModel: Rename parameter `apply_filter` to `reset`
2022-10-26 11:16:12 +02:00
Tobias Hunger
107c68e35a janitor: Update toml-edit to 0.15 2022-10-26 08:59:36 +02:00
Tobias Hunger
9b30cacd0c vtable-macro: Fix syntax error in Cargo.toml 2022-10-26 08:59:36 +02:00
Tobias Hunger
2bbf236e25 janitor: Update clap to 4.0 (+fix some typos) 2022-10-26 08:59:36 +02:00
Simon Hausmann
ee39f3802e janitor: Fix warning about use of deprecated functions from ttf-parser 2022-10-24 17:51:36 +02:00
Simon Hausmann
296365cd57 janitor: Bump femtovg and ttf-parser versions 2022-10-24 17:47:19 +02:00
Simon Hausmann
40f6174d19 janitor: Fix build of corelib tests
rustbyzz 0.5.3 was released, which also removes the ttf parser re-export. Bump to 0.6 to fix that.
2022-10-24 17:44:17 +02:00
Olivier Goffart
fc37aa9053 CI: test the updater and the new syntax 2022-10-24 17:40:09 +02:00
Olivier Goffart
2e4d42d356 Syntax updater: remove the conditional flags and always update to the new syntax 2022-10-24 17:40:09 +02:00
Simon Hausmann
c16253d29f Use Property<LogicalLength> instead of Property<Coord>
This removes the special code for the generated property getters and
ensures type safety in the run-time library for property value setting.

In the Rust generated code we continue to do arithmetic on the scalar
values, that means we immediately extract the scalar, do arithmetic and
rely on the compiler to only allow compatible units.

Danger zone alert: In the interpreter Value::Number can now be converted
to LogicalLength as-is.
2022-10-24 12:49:37 +02:00
Olivier Goffart
d505ac4809 CI: crater: fix yaml file 2022-10-24 12:25:11 +02:00
Olivier Goffart
5102bcc9dc CI: update the crater
Remove all the crates still using 0.2.x, and update with a bunch of repo
found on github
2022-10-24 12:21:55 +02:00
Olivier Goffart
24f01e1523 More changes to the changelog 2022-10-24 11:04:59 +02:00
Olivier Goffart
2e08b7dd1e Fix the rendering size of svg
- On the web, to return the image size, we need to use the natural size
   of the image, and not its dom size, as the later get modified since
   commit  b727aba4a0

 - The target size did not take in account the image fit, that's because
   former version of resvg could only render by respecting the aspect
   ratio. But since the web don't have this limitation, we now need to
   take it into account. And new version of resvg can also scale with
   any aspect ratio
2022-10-24 10:05:38 +02:00
Olivier Goffart
1fcbae5309 Updates to changelog 2022-10-24 08:51:30 +02:00
Simon Hausmann
6dc67d5b7b janitor: work around rustybuzz version incompatibility
Use the re-export to avoid a version clash for ttf-parser.
2022-10-23 14:36:44 +02:00
Tobias Hunger
a0061bdaa7 online editor: Support attribute grouping
The LSP now groups attributes. Support that in the online editor
2022-10-21 18:13:23 +02:00
Tobias Hunger
96acd16d2f online_editor: Navigate to property value 2022-10-21 18:13:23 +02:00
Tobias Hunger
079b26a264 online_editor: Merge type info into value column of property editor
Merge the type information of the properties into the value column as a
tooltip.

Also add some tag into the output via CSS: This should be replaced with
proper icons!
2022-10-21 18:13:23 +02:00
Olivier Goffart
ae2edbbbee online editor: improve the welcome screen 2022-10-21 18:10:48 +02:00
Florian Blasius
c58c704f16
Change type of Window background from color to brush (#1755) 2022-10-21 16:17:22 +02:00
Olivier Goffart
659cb3a06c LSP: fix property call on invalid base or non-main component
- We should not panic if the base type is invalid
 - We should try to keep bindings in the Element even if the base type
   is invalid
 - Fix querying the element at a position in case it is not in the last
   component of a file
2022-10-21 12:50:42 +02:00
Olivier Goffart
f5314625d9 lsp: Group and sort properties in the property extension call
Group property from the base class they are defined, and for built in
property, group them by category.
Also filter callback and other reserved properties that are not valid
for some elements.
2022-10-21 12:50:42 +02:00
Olivier Goffart
70e8dedb75 Remove leftover dbg! 2022-10-21 12:15:48 +02:00
Tobias Hunger
ff504c0bdd online_editor: Format with prettier 2022-10-21 12:13:29 +02:00
Tobias Hunger
fe38ae9762 online_editor: Make document outline highlight where the cursor is
Make the document outline set the "active" class on the element the
cursor is currently in.

Include some css to make the browser show what is active.
2022-10-21 12:13:29 +02:00
Olivier Goffart
1b58ab93f1 Fix documentation of CompilerConfiguration::embed_resources
It was just a copy paste of with_style
2022-10-21 10:33:54 +02:00
Tobias Hunger
41bc847151 online-editor: Improve type safety
Use `monaco.Uri` more in the internal parts of the `EditorWidget`, add
`TextRange` and `TextPosition` types and use them to data around.

Also fix a bug introduced when switching to the tree of items in the
outline editor and another small bug with the file tab name changing for
temporary files. Sorry for mixing this into this patch, but I discover
the issue while working on improving type safety.
2022-10-20 18:41:34 +02:00
Olivier Goffart
0ba8f58076 New syntax: New lookup rules for unqualified identifier
Instead of looking up any property in `self` and `root`, only resolve
the properties in scope declared in the current component.
2022-10-20 16:40:29 +02:00
Simon Hausmann
bd412623ab
Online editor: Fix binding expression text shown in the properties view (#1753)
Use the zero-line based lsp range/position types for the QueryProperties
lsp command results and convert them to monaco editor ranges for correct
text extraction.
2022-10-20 15:49:23 +02:00
Tobias Hunger
868d5f9de2 Update node version to 16 2022-10-20 15:42:50 +02:00
Simon Hausmann
54934d1f0b Fix the cursor position when receiving composition update events
Since the DOM API doesn't provide the values, we can just place the
cursor ourselves.
2022-10-20 12:37:28 +02:00
Olivier Goffart
f3f34c3a02 wasm: Use the composition API
Pros: the composition shows up as selected
Cons: te cursor is shown at the begining of the preselection, and
clicking on the field commit the selection at the wrong place
2022-10-20 12:37:28 +02:00
Tobias Hunger
366d2fb186 online-editor: Fix lint warnings 2022-10-20 12:12:47 +02:00
Tobias Hunger
f3648313cc online_editor: Put document outline into ul
Implement the tree structurer -- and not in a flat list of rows.
2022-10-20 12:12:47 +02:00
Tobias Hunger
57969cc972 online_editor: More type-safety in outline widget 2022-10-20 12:12:47 +02:00
Tobias Hunger
3553e21ff8 online_editor: Make navigation via document outline work
-- with more off by one errors! :-)
2022-10-20 12:12:47 +02:00
Tobias Hunger
c629c4ab62 online_editor: Make outline widget print some data 2022-10-20 12:12:47 +02:00
Tobias Hunger
ec79a98d0d online_editor: Add empty outline widget 2022-10-20 12:12:47 +02:00
Tobias Hunger
6c6993872c online_editor: Use _only_ the uri defined in the ITextModel
We used to have a hand-rolled URL to address the different files open in
the online editor. This got increasingly problematic as the monaco
editor, the slint language server, the previewer and the online editor
code all need to agree on those URLs to be able to cross-reference the
different files.

This patch makes sure we have the URL in ITextModel *only* und use that
consistently everywhere.
2022-10-20 11:39:42 +02:00
Olivier Goffart
69b15043d4 Gate the new syntax with an environment variable 2022-10-20 08:02:26 +02:00
Olivier Goffart
b24a2d6a57 new syntax: comments from review 2022-10-20 08:02:26 +02:00
Olivier Goffart
fd23745c02 Test for the input output properties 2022-10-20 08:02:26 +02:00
Olivier Goffart
baeb2cd419 New language syntax: allow struct declaration without ':=' 2022-10-20 08:02:26 +02:00
Olivier Goffart
9518e7184d Check access rights when accessing properties within expression 2022-10-20 08:02:26 +02:00
Olivier Goffart
c1f4f4e96b Start working on input/output properties 2022-10-20 08:02:26 +02:00
Olivier Goffart
a3ba7bf78a syntax_updater: Continue new syntax, add it to the parser
This re-adds inheritence with the "inherits" keyword
2022-10-20 08:02:26 +02:00
Olivier Goffart
9d0c6bfc84 WIP syntax_updater: new component declaration 2022-10-20 08:02:26 +02:00
Olivier Goffart
98a922bf42 syntax_updater: Experimental support for input/output properties 2022-10-20 08:02:26 +02:00
Olivier Goffart
bc4e57949c syntax_updater: Remove the from argument
and all the code that was there to update from 0.1.0 or less
2022-10-20 08:02:26 +02:00