Simon Hausmann
16a75a2ff8
Parse return statements
2021-01-25 15:32:00 +01:00
Simon Hausmann
f502be9299
Fix nested structures
...
When the nested structure was only referenced indirectly, we weren't collecting it for code generation.
2021-01-25 14:12:24 +01:00
Simon Hausmann
a69ce3a397
Remove the 'align-' prefix from TextHorizontal/TextVerticalAlignment
2021-01-25 10:59:18 +01:00
Simon Hausmann
7ef8a866d9
Add support for qualified enum lookups
2021-01-25 10:44:17 +01:00
Simon Hausmann
2801e82658
Changed the KeyEvent in .60 to be an object
...
This exposes the text as well as the keyboard modifiers and is a little
more extensible.
2021-01-22 18:05:34 +01:00
Olivier Goffart
788a882c80
C++ Use u8"" string
2021-01-22 12:33:26 +01:00
Olivier Goffart
3636c76848
Also forward the LineEdit focus in the native style
...
Just like in the ugly style
2021-01-21 13:21:09 +01:00
Simon Hausmann
521e15e5b0
Add a forward-focus
declaration for LineEdit
...
This allows calling `focus()` on a `LineEdit`.
2021-01-20 15:52:58 +01:00
Simon Hausmann
1bf5a56c39
Rename initial-focus
to forward-focus
2021-01-20 15:52:58 +01:00
Simon Hausmann
f7ea2a9dce
Forward focus() calls on items that have initial-focus
defined
...
This also makes the focus() method available as a member function on any
item, but the resolve_element_reference_in_set_focus_calls() pass will
check if the elements are valid.
The check for `has-focus` to determine a focusable item was replaced
with an annotation on the built-in elements, so that `has-focus` can
later be implemented as a built-in function through the run-time,
without the need for a boolean property.
2021-01-20 14:31:01 +01:00
Simon Hausmann
6143d6c471
Minor cleanup
...
Turn the internal
(crate::diagnostics::SourceFile, crate::diagnostics::Span)
tuple into a named SourceFile struct, for re-use later.
2021-01-20 12:07:37 +01:00
Olivier Goffart
094287697a
Add a FocusScope
...
C++ part not working because the Callback with arguments are not yet supported with C++
2021-01-20 10:00:19 +01:00
Olivier Goffart
f454c5cd8e
C++: properly escape non-printable characters
2021-01-20 09:53:55 +01:00
Olivier Goffart
38a3c0655c
Add support for \u{xxx} escape sequences in stirng literal
2021-01-20 09:11:06 +01:00
Olivier Goffart
78484a75e0
Add string tests I forgot to git add previously
2021-01-19 19:39:42 +01:00
Simon Hausmann
5f265ffc09
Split up ComponentWindow::run() into show(), hide() and sixtyfps::run_event_loop()
...
This allows creating multiple windows for example, and it will allow for
showing windows in those tests that require a mapped window.
As a bonus, the run() function on generated components is not consuming
anymore.
2021-01-19 09:50:22 +01:00
Olivier Goffart
8dc79699de
String template concatenation
...
Currently not supported in the sixtyfps macro
2021-01-18 16:09:58 +01:00
Olivier Goffart
882bd7ddb7
Lex template string
2021-01-18 14:43:54 +01:00
Olivier Goffart
ba6ff5736c
String Escaping
2021-01-18 13:36:23 +01:00
Simon Hausmann
1b34b7f90b
Simplify img! relative path resolution logic a little
...
Amend commit 3e90a3c827
by using
unwrap_or_else() instead of if {} else {}
2021-01-18 08:43:18 +01:00
Simon Hausmann
5dc7468b8a
Remove stray line
2021-01-15 20:53:57 +01:00
Simon Hausmann
58768bf70a
Add default bindings for width/height for Image and Text to their implicit size
2021-01-15 17:58:32 +01:00
Simon Hausmann
3e90a3c827
Improve relative image path resolution
...
Don't just try to resolve relative paths against the current path,
resolve them against all directories in the include search path.
Together with the include search path directive for tests in tests/cases
this will allow working around the fact that the base directory for the
rust tests is different than for the C++/NodeJS tests.
2021-01-15 16:28:17 +01:00
Olivier Goffart
9ace1fcc78
Upgrade dependencies
2021-01-15 15:43:38 +01:00
Olivier Goffart
dc0a59a713
C++, Windows: Fix escaping slashes in resource name
2021-01-14 10:34:18 +01:00
Olivier Goffart
090039094f
C++: rename component_type to static_vtable
...
Then there is no reference to "component" in vtable.h
2021-01-14 09:39:21 +01:00
Olivier Goffart
8797f6512d
Rename Slider min/max property
...
For consistency with the SpinBox
Fixes https://github.com/sixtyfpsui/sixtyfps/issues/138
2020-12-30 10:02:38 +01:00
Olivier Goffart
56b67eac8c
Complete the last patch to add a minimum/maximum properties to the SpinBox
2020-12-29 09:44:19 +01:00
Seo Sanghyeon
6ec1c2b446
Add minimum to SpinBox
2020-12-29 09:32:56 +01:00
Olivier Goffart
57804b64a3
Don't use the canonical path for diagnostics
2020-12-28 15:07:49 +01:00
Olivier Goffart
36ea03ecff
fix test compile
2020-12-28 14:39:42 +01:00
Olivier Goffart
9aca0b0a7e
LSP: Allow to access to the type loader documents
...
So that we can go to the definition of un-open documents
2020-12-28 12:48:32 +01:00
Olivier Goffart
8267590282
Refactor: move a bunch of code in TypeLoader::new
...
So it will be shared
2020-12-28 12:48:32 +01:00
Olivier Goffart
7fcb49bef1
Implement Go to definition for elements
2020-12-23 15:15:53 +01:00
Olivier Goffart
61399e566a
Add a title to the Window
...
also add a color, but not yet implemented
2020-12-18 16:47:14 +01:00
Olivier Goffart
16f5a03c14
Run cargo fmt
2020-12-18 10:29:15 +01:00
Olivier Goffart
dfa25b96f7
Rename SharedArray to SharedVector
2020-12-18 10:26:07 +01:00
Olivier Goffart
0d2d48be4f
Rename "signal" to "callback"
2020-12-18 09:51:01 +01:00
Simon Hausmann
625978fe1a
WIP: Add an image-fit property to Image/ClippedImage
2020-12-15 10:26:54 +01:00
Olivier Goffart
f3a5034344
Style
2020-12-14 12:56:38 +01:00
Olivier Goffart
9d50960c98
More fixes to disabled widgets
2020-12-14 11:43:19 +01:00
Olivier Goffart
26827733ac
Fix: disabled slider should not react to click
2020-12-14 09:44:10 +01:00
Olivier Goffart
63a0d9308b
Bump version
2020-12-14 08:49:54 +01:00
Simon Hausmann
5f9f1ce047
Fix the build
...
Fix the remaining CompilerConfiguration uses that I missed :(
2020-12-10 16:13:17 +01:00
Simon Hausmann
87e0cc7d85
Fix resource embedding doing a wasm build of a project using the sixtyfps! macro
...
We need to embed resources in wasm builds. Unfortunately we can't detect
that we're called by say wasm-pack and "TARGET"/"HOST" only works inside
build.rs. So instead, to keep things simple, this change always embeds
the image resources when targeting Rust.
The `SIXTYFPS_EMBED_RESOURCES` environment variable can be used to
override this anywhere for any language.
Fixes #130
2020-12-10 15:09:32 +01:00
Olivier Goffart
7f04301bca
C++: Do not set the window root in the component creation
...
Set it when calling run on the window.
Otherwise the last created component becomes the root
2020-12-10 11:35:38 +01:00
Olivier Goffart
125ec13f24
Bump version numbers
...
Note: this does not update the documentation yet
2020-12-07 15:41:29 +01:00
Olivier Goffart
7f78bea8b5
Fix a bunch of cargo clippy warnings in the compiler
2020-12-07 12:54:38 +01:00
Olivier Goffart
2a751fcdc8
Remove debug output
2020-12-07 11:39:27 +01:00
Olivier Goffart
f9dc2af9f1
Small style change
2020-12-05 17:48:02 +01:00