Commit graph

1514 commits

Author SHA1 Message Date
Florian Blasius
abe558313d
material: improve groupbox visual (#2749) 2023-05-17 17:19:08 +02:00
Olivier Goffart
b847faa027 Typeloader: In case of load error, don't keep invalid files as currently loading
Because we `return None` in case of error before we remove the file from `currently_loading`
we would then await forever next time we try to load that file.

This will cause a deadlock that can be causing #2709
2023-05-15 16:10:35 +02:00
Olivier Goffart
eb88a9ac9c Adjust sizing of the AboutSlint widget 2023-05-09 12:19:18 +02:00
Olivier Goffart
6441968a43 Janitor: Remove trailing spaces in most files 2023-05-04 08:14:28 +02:00
Olivier Goffart
b098234ad4 consistent_styles test: Ignore TabWidgetImpl
We already ignore other internal stuff
2023-05-04 08:01:48 +02:00
Olivier Goffart
df2f76a65b Make the non-native TabWidget fill the parent size when not in layout
Fix #2683
2023-05-04 07:23:04 +02:00
Olivier Goffart
5c4a1746d4 LSP: fix completion of callback arguments 2023-05-03 09:09:01 +02:00
Olivier Goffart
6111b17a7c Proper error when wrong type used in an unary operation
Fixes #2669
2023-05-02 17:41:36 +02:00
Tobias Hunger
bb67122a50 LSP: Remove offset to position mapper 2023-05-02 15:12:01 +02:00
Olivier Goffart
d881a4fb66 Syntax tests: move some tests to another folder
tidy a bit the basic directory
2023-05-02 13:06:50 +02:00
Cole Lawrence
95e00c5621 Support negative numbers in cubic-bezier(...) function 2023-05-02 09:48:32 +02:00
Cole Lawrence
26fbef9cc0 collect_structs: visit function args and returns
Prevent compilation error in the generated code when dealing with
structs only referenced by public functions.

Fixes #2655
2023-04-29 08:24:17 +02:00
Tobias Hunger
cf1984f544 compiler: Add a test for mapping offset to/from line/column
... in SourceFile. Let's hope that this will finally make sure that
this works properly!
2023-04-27 21:07:26 +02:00
Tobias Hunger
31147fecd7 compiler: Fix mapping from offset to line/column in SourceFile 2023-04-27 21:07:26 +02:00
Tobias Hunger
bb3109443a compiler: Allow mapping from line/column to offset
Add a method to the SourceFile so that we can map back from line/column
values to offsets.
2023-04-27 21:07:26 +02:00
Tobias Hunger
43aae1de1c Interpreter: Include the id := in Elements
Include the "id :=" part when highlighting an Element. This places the
cursor at the 'i' now.

Done-with: @ogoffart
2023-04-26 20:49:12 +02:00
Tobias Hunger
bbdd6aeab7 compiler: Ignore leading whitespace when parsing
... and update all out test cases accordingly.
2023-04-26 17:22:13 +02:00
ogoffart
dfd5fc38b3 Bump version number to 1.0.3 2023-04-26 14:04:08 +00:00
ogoffart
53cce5bf44 Bump version number to 1.0.2 2023-04-26 11:33:16 +02:00
Olivier Goffart
ae1fb4c7cf Handle complex forward-focus loops 2023-04-24 18:03:33 +02:00
Olivier Goffart
7e7b9176a7 Don't infinite loop when forwarding focus to self 2023-04-24 18:03:33 +02:00
Olivier Goffart
b9d139fd6e Fix focussing element whose base is focusable
Fixes #2622
2023-04-24 18:03:33 +02:00
Simon Hausmann
6c8fa5f215
Fix duplicated loading/embedding of images (#2612)
For .slint files that are included, we canonicalize the path before
adding it into the import stack, to avoid duplicates. We didn't do that
for images in the global_embedded_resources.

Ensure this by canonicalizing as early as possible.

Fixes #2608
2023-04-21 13:15:22 +02:00
Olivier Goffart
1d3d19536e Use the dlopen feature for fontconfig
closes #2376
2023-04-19 17:25:02 +02:00
Olivier Goffart
621ca4f56c Janitor: update deps 2023-04-19 17:20:51 +02:00
Olivier Goffart
7ef9d9b7ec LSP: complete the first import right before the first component
So this doesn't break the slint! macro (add the import at the beginning
of the rust file)
2023-04-19 17:19:55 +02:00
Olivier Goffart
4076df928d Fix panic when getting the line, column of diagnostic with invalid span
Introduced in cbc0c790a3
2023-04-19 12:35:17 +02:00
Olivier Goffart
cbc0c790a3 Make Disagnostice::line_colunm 1 based
Commit 893983e8d3 "fixed" it to be 0 based as it was
documented. But that's a change of behavior so restore the previous behavior and
document it properly
2023-04-19 11:02:33 +02:00
Tobias Hunger
893983e8d3
Slintpad: Add picker mode where you can click on something in the preview and the editor focuses on that (#2567)
* compiler: Make mapping from source offset to line/column more reusable
* compiler: Improve mapping of offset to line/column
* Fix unit tests after line mapping update
* interpreter: Add code to have a element picker mode
* slintpad: Add picker mode to the preview
* slintpad: Do not try to highlight "empty" highlight requests
* Slintpad: Cycle through all the possible elements in design mode
* Slintpad: Ignore builtins and eat less clicks
* Slintpad: Highlight the element selected in design mode
* Slintpad: Do not use static mut variable in design mode
* slintpad: Rename `set_current_element_information_callback`
* Interpreter: Do not use unsafe in design mode code

Done with: @ogoffart and @tronical
2023-04-18 23:11:08 +02:00
ogoffart
bd63218412 Bump version number to 1.0.1 2023-04-18 14:56:40 +00:00
Olivier Goffart
a1ea00553f Compiler: hint when an id has the same name as a property or enum value 2023-04-18 16:16:31 +02:00
Olivier Goffart
875a7ea179 Parser: Nicer error when extra top-level semicolon
Recover from extra semicolon
2023-04-17 15:13:20 +02:00
Olivier Goffart
a7b8bafdf9 Ensure completion in the document in case of parse error or empty document
Every token must be part of a document, including the EOF,
otherwise completion don't work at the end of the document.
2023-04-17 07:58:18 +02:00
Olivier Goffart
ee9f730a6d Parser: Don't parse everything as a component
The old parser always try first to find `Foo :=` from the old syntax so it
would error saying it expect an identifier or `:=`
But if we don't find a component, don't try to parse it as a component too early
This way we get better error and better auto-completions
2023-04-17 07:58:18 +02:00
Olivier Goffart
40922874fa parser: don't parse error on empty import statement
Report the error later when loading the import.
That way, we get a more complete AST for auto-completion
2023-04-17 07:58:18 +02:00
Cole Lawrence
af30896e4a Add always-on-top property to Window element 2023-04-15 13:58:47 +02:00
Olivier Goffart
82ae83ce8c Parser: don't have the whitespace as part of an expression
That way the error for an expression is at a better location, and
this also prevent the formater that removes space in expressions to
remove the spaces before the expression that shouldn't be removed
2023-04-14 17:46:19 +02:00
Olivier Goffart
946552b0c5 Fixes access to unset layout property
The previous code was only re-creating the layout properties for these
that had a binding, but that wasn't done if the property was just read,
leading to access to non-existing properties later.

Fixes #2483
2023-04-14 13:51:57 +02:00
Olivier Goffart
7b26d6e58f Native ScrollView: Forward the minimum size 2023-04-13 19:23:20 +02:00
Simon Hausmann
ea769cb10c C++: Make sure embedded image data is declared const 2023-04-12 16:14:13 +02:00
Olivier Goffart
a57c7eb6bc Added TextInputInterface.text-input-focused 2023-04-12 14:49:08 +02:00
Olivier Goffart
6d0d6911f4 Fix visitation of init code
This patch merges the changes from #2344 and #2491 and do some cleanup

In particular, this visit the init code expression when visiting the
root element expression

Closes #2344
Closes #2491
Fixes #2487
2023-04-11 21:30:01 +02:00
Olivier Goffart
208d89c1de LSP: Don't auto-complete reserved properties or sub-elements for globals 2023-04-05 20:05:09 +02:00
Simon Hausmann
d87af7e917 Fix panic when binding Path's commands property to a model entry's field
Fixes #2466
2023-04-03 15:25:13 +02:00
Olivier Goffart
faeaef9143 Qt TabWidget: clip the tabbar to fix the breeze style 2023-03-30 19:16:43 +02:00
Olivier Goffart
c93b5b1be8 typeloader: make sure the vector of wakers don't grow too much
Poll can be called many times with the same waker
2023-03-30 10:48:38 +02:00
Olivier Goffart
bca5f136de typeloader: don't think we recurse if we're loading twice the same file at the same time
It can just be that we need to await for it.
And we need to maintain another stack for the case where we indeed
recurse
2023-03-30 10:48:38 +02:00
Olivier Goffart
ba407694ac Load files in parallel
Should speedup the loading of big project in the online code editor
2023-03-30 10:48:38 +02:00
Olivier Goffart
3404792114 Refactoring: Make the TypeLoader function take a RefCell
So they can operate without mutably borrowing across await
2023-03-30 10:48:38 +02:00
Olivier Goffart
cdaf2abb47
C++: sort the member of a struct in the same order as in the .slint file 2023-03-29 19:11:33 +02:00