Commit graph

70 commits

Author SHA1 Message Date
Olivier Goffart
183f300a85 Implement the temperature converter in the .60 code
A edited signal was required on the line edit
2020-11-03 18:23:37 +01:00
Olivier Goffart
11e55dd8d2 String -> Float conversions 2020-11-03 15:19:58 +01:00
Olivier Goffart
4a182ef4d0 Layout alignment 2020-11-03 12:22:34 +01:00
Olivier Goffart
59707f068c add a enabled property on the line edit 2020-11-02 18:20:01 +01:00
Olivier Goffart
d3801e26d3 Change the syntax of structures to require the struct keyword 2020-10-27 16:09:05 +01:00
Olivier Goffart
dc98487160 Add a placeholder-text property to LineEdit 2020-10-27 10:55:08 +01:00
Olivier Goffart
07589f3037 Document HoizontalLayout and VerticalLayout 2020-10-26 19:25:24 +01:00
Olivier Goffart
76b7f1aef6 Allow dashes in identifier
Currenly, dashes are normalized to '_'.
Dashes are not allowed at the begining of an identifier.
If an identifier with a dash is not found, we also look for identifier
without a dash and if that exist, we hint the user to use spaces.

Issue #52
2020-10-22 18:32:25 +02:00
Olivier Goffart
45e8c94535 Some more documentation for the rust backend 2020-10-21 10:35:42 +02:00
Simon Hausmann
3b051f2176 Clarify hexadecimal color encoding
We parse hex colors as per CSS, including the #RRGGBBAA variant, as per
https://www.w3.org/TR/css-color-4/#hex-notation . This is now documented
and the JS conversion also generates that instead of #AARRGGBB.
2020-10-19 16:38:58 +02:00
Simon Hausmann
13f845ee4f Add support for property<percent> 2020-10-16 18:56:54 +02:00
Simon Hausmann
cf87ac804b Add support for relative lengths
Typically `some_length_prop: 40%` produces an error, but if there's a
matching property in the parent, then it will be allowed and interpreted
as relative value and creates a dynamically updated binding.
2020-10-16 18:54:04 +02:00
Simon Hausmann
a695d551da Small typo fix 2020-10-16 14:59:58 +02:00
Simon Hausmann
6c45ccc8a6 Fix syntax error in docs
The syntax updater found this one :-)
2020-10-16 12:30:11 +02:00
Simon Hausmann
6aa292eac1 Change the names of the logical and physical pixel units
The logical pixels are now just called "px" and the less frequently
used physical pixels have the "phx" suffix.

The existing markup was adapted using the syntax updater and the
following patch:

    +    if node.kind() == SyntaxKind::NumberLiteral {
    +        if node.text().ends_with("lx") {
    +            return write!(
    +                file,
    +                "{}px",
    +                node.text().as_str().split_at(node.text().as_str().len() - 2).0
    +            );
    +        }
    +        if node.text().ends_with("px") {
    +            return write!(
    +                file,
    +                "{}phx",
    +                node.text().as_str().split_at(node.text().as_str().len() - 2).0
    +            );
    +        }
    +    }

Fixes #49
2020-10-16 07:19:40 +02:00
Olivier Goffart
e48f0b7621 Add a current item to the StandardListView 2020-10-14 14:32:18 +02:00
Olivier Goffart
519de0f860 Allow convertion of object type even if a property is missing 2020-10-14 13:53:44 +02:00
ritschwumm
f236a7b7c7 fix typos 2020-10-14 09:18:06 +02:00
Olivier Goffart
8f1c5a96c1 Fix ListView being scrollable when it shouldn't
Relates to #86
2020-10-13 13:45:18 +02:00
Olivier Goffart
6075860c9e Documentation about how to generate the doc 2020-10-13 09:54:35 +02:00
Simon Hausmann
9c23d9b571 Alternate fix for image loading in docs preview
Revert commit 9f488bba3b for now and
instead resort to an absolute url to the image. This way we
don't have to use the wrong base url.
2020-10-13 09:44:25 +02:00
Simon Hausmann
9f488bba3b Try to get the image loading work in the embedded doc preview
By specifying the CORS-friendly github raw url as base url for the interpreter,
we can load images using relative paths.

According to the inspector the image is loaded successfully,
so what seems to be left to fix is an event loop related issue.
2020-10-13 09:31:42 +02:00
Simon Hausmann
b3a591cef0 Small grammar fix 2020-10-12 21:27:01 +02:00
Simon Hausmann
e301c19fd0 Fix typo 2020-10-12 21:24:43 +02:00
Olivier Goffart
d0611d8491 Document widgets that were missing documentation 2020-10-12 13:36:25 +02:00
Olivier Goffart
23e9a5f339 Fix some spelling issues in README and doc 2020-10-12 12:59:40 +02:00
Olivier Goffart
4bdf447b11 C++ build documentation and README 2020-10-08 12:25:12 +02:00
Simon Hausmann
5e972bdf81 Add docs for building for the pi
Fixes: #78
2020-10-07 15:07:39 +02:00
Simon Hausmann
7e0e7b43f0 Add support for calling focus() on TextInput elements
This allows activating text inputs in signal handlers connected for
example to buttons.

This implements parts of #55
2020-10-01 08:52:45 +02:00
Simon Hausmann
9ad8968529 Add support for the initial_focus synthetic property
Setting it will translate to a set_focus_item call in the constructor.

This implements parts of #55
2020-09-30 15:11:01 +02:00
Olivier Goffart
805ffd216b Document the two way binding 2020-09-24 09:33:08 +02:00
Simon Hausmann
2da84fee46 Add a boilerplate TextInput item 2020-09-18 16:34:24 +02:00
Olivier Goffart
cbd8c6aefc Documentation for the newly added struct type 2020-09-17 13:14:01 +02:00
Olivier Goffart
3c6f378982 Document that signals can have parameter 2020-09-09 11:35:38 +02:00
Olivier Goffart
c3a53a360f Additions to the building documentation 2020-09-07 10:46:02 +02:00
Simon Hausmann
e19ad3006a
Suggest to run the dynamic viewer on the printer demo instead of the less polished example :) 2020-09-04 14:56:47 +02:00
Simon Hausmann
37b10b78f8
Moved the examples build & run docs to the example folder 2020-09-04 14:55:16 +02:00
Simon Hausmann
5cd5d5ab62 Avoid overlapping text in the preview of the first langref example
On my screen the "world" is drawn over the "hello", which looks bad.

Use scalable pixels instead of physical pixels, in an effort to decrease the
chances of overlap while maintaining simplicity in the example.
2020-09-04 10:12:34 +02:00
Simon Hausmann
3eef23f93c Add widgets to the C++ docs as well 2020-09-03 12:05:50 +02:00
Simon Hausmann
adec90e8d2 Ident all builtin elements by one level
Looks much nicer in the C++ docs :)
2020-09-03 09:48:53 +02:00
Simon Hausmann
8b45efd16d Put all builtin element names into blocks 2020-09-03 09:39:08 +02:00
Olivier Goffart
8a7afbc238 Documents the elements 2020-09-02 18:57:24 +02:00
Simon Hausmann
fd9aea97eb Fix markdown table rendering in C++ docs
This reverts commit 0bb904e10a and
re-introduces the markdown table support extension. The resulting table
by default is too wide in the "responsive" read-the-docs theme, but with
a CSS tweak it becomes readable.

Markdown tables are much easier to deal with and this way we can also
include references within the tables.
2020-09-02 17:06:41 +02:00
Simon Hausmann
fbb1064107 Small doc fixup 2020-09-01 14:28:38 +02:00
Olivier Goffart
159d8b615a Some adjustment to the examples in langref 2020-09-01 14:27:00 +02:00
Olivier Goffart
e80580b5d7 fixup doc 2020-09-01 13:42:19 +02:00
Olivier Goffart
16e4de05b5 Document GridLayout 2020-09-01 13:31:41 +02:00
Simon Hausmann
c1aa4b28c6 Add support for children insertion points for components
Sometimes re-usable components need to act as containers that allow the
user to place other items inside. The component needs to be able to
control the placement of these user-provided elements. That is what the
new

    $children

expression inside elements does.
2020-08-28 15:05:21 +02:00
Olivier Goffart
10e8d7ffb9 Replace the regexp-based lexer with a custom lexer
The regexp crate is huge and takes more than a third of the size of the
wasm-interpreter.
2020-08-28 13:34:43 +02:00
Simon Hausmann
0bb904e10a Fix broken type table in language reference embedded in C++ docs
Recommonmark doesn't grok markdown tables. There's an extension for that, but it
doesn't do support line breaks (or requires manually breaking lines).

So instead this uses a HTML table for now, which
looks identical in github and rust and okay'ish in sphinx/C++.
2020-08-26 13:51:53 +02:00