Commit graph

963 commits

Author SHA1 Message Date
Olivier Goffart
97917c43db Fix selecting the minimal class when no properties are used
Otherwise `Rectangle{}`  would be a BorderRectangle
2021-01-28 18:52:39 +01:00
Olivier Goffart
fea2478859 Update version number everywhere 2021-01-28 16:34:13 +01:00
Olivier Goffart
82aa658cef Update rowan 2021-01-28 15:37:01 +01:00
Olivier Goffart
8e8c6ab690 Avoid self-references in the created layout properties
Fixes #140
2021-01-28 15:06:19 +01:00
Olivier Goffart
52d750999b Pretty-print expression and better debug for Element 2021-01-28 14:36:16 +01:00
Simon Hausmann
6a4f2aa572 Added the two missing path sub-elements for quadratic and cubic curves 2021-01-28 14:14:24 +01:00
Simon Hausmann
a6fbc4c05d Add missing MoveTo sub-element for Path 2021-01-28 13:16:25 +01:00
Olivier Goffart
0cc2a40085 Another fixup 2021-01-28 12:03:52 +01:00
Olivier Goffart
3b968c8a8e Fixup previous commit
the $children replacement shouldn't have replaced rust code
2021-01-28 11:58:43 +01:00
Olivier Goffart
07df517473 Replace $children with @children 2021-01-28 11:55:08 +01:00
Olivier Goffart
bb4212f0aa Remove bang macro support 2021-01-28 11:49:24 +01:00
Olivier Goffart
23a511b380 Replace img!"..." by @image-url("...") 2021-01-28 11:49:24 +01:00
Olivier Goffart
5debc08f98 Parse @image-url 2021-01-28 11:49:24 +01:00
Simon Hausmann
6c517b04cf Fix expected error message 2021-01-28 09:12:06 +01:00
Simon Hausmann
e14c0df231 Fix unit of path stroke width property 2021-01-28 09:10:07 +01:00
Simon Hausmann
f8eec03296 Allow drop-shadow on Clip
Commit d03da6b57b illustrates how this
would be rather convenient. Eventually perhaps `Clip` can turn into a
boolean `clip: true` property.
2021-01-28 08:40:09 +01:00
Simon Hausmann
ab25faa24f Add automatic creation of BoxShadow elements through drop-shadow properties on Rectangles 2021-01-27 19:02:23 +01:00
Simon Hausmann
96f7851ed5 Minor cleanup in reserved property handling
Group the properties into separate const arrays, for improved
readability and re-use later.
2021-01-27 17:44:39 +01:00
Simon Hausmann
680995432e Minor fixes to the BoxShadow element
* Use the same property names as `Rectangle`
* Use the same sizing behavior

Also added a "manual" test.
2021-01-27 15:34:27 +01:00
Olivier Goffart
647f7effcd Add TextWrap and TextOverflow enum and corresponding property in Text
Although they ar enot working yet
2021-01-27 11:40:09 +01:00
Olivier Goffart
edcd4b1d0b Move the generate_item_indices function in a a passes modules 2021-01-27 09:21:26 +01:00
Olivier Goffart
c099ac98da Fix some invalid identation 2021-01-26 17:25:55 +01:00
Olivier Goffart
397ccf518a Properly error when the return value of a signal is missing 2021-01-26 17:18:01 +01:00
Olivier Goffart
9de5af75ce Allow FocusScope to reject the events 2021-01-26 17:05:31 +01:00
Olivier Goffart
e0e3a1aaad Fix parent_item()
We need to skip over the DynamicItem
2021-01-26 17:05:30 +01:00
Simon Hausmann
628e6fdb38 Add a BoxShadow element
This intends to provide a configurable rectangular "drop shadow". The
API is modeled after CSS/HTML5 Canvas where the element can be "bound"
to an existing rectangular shape (geometry and radius), the offset can
be used to place the shadow and color and blur configure the shadow.

The shadow's color fades into transparent.

TODO (in subsequent changes):
 * Documentation
 * Qt implementation
2021-01-26 13:56:12 +01:00
Olivier Goffart
a4abb86782 Don't return the ItemWeak by value
It is not working in C++ because ItemWeak has a destructor
2021-01-26 13:17:24 +01:00
Olivier Goffart
c2982d9ab3 Add ability to get the parent item from the vtable
(still untested)
2021-01-26 10:36:37 +01:00
Olivier Goffart
5a21f1bd81 Rename emit_ to call_ for callback
Signal was renamed to Callback, but one does not emit a callback, one calls it
2021-01-25 15:59:10 +01:00
Olivier Goffart
7ac219e6d2 Return statement: check that the return type is correct 2021-01-25 15:32:00 +01:00
Olivier Goffart
c2dc0cef2c Finish return statement handling 2021-01-25 15:32:00 +01:00
Simon Hausmann
b22bbb1c0f WIP: Implement the return statement 2021-01-25 15:32:00 +01:00
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