Commit graph

134 commits

Author SHA1 Message Date
Olivier Goffart
9bcd8ca236 Docs: Add example for aimation-tick 2022-07-11 17:49:28 +02:00
Olivier Goffart
92b4f52556 Make mod() a macro that can take generic types instead of just integer 2022-07-11 17:49:28 +02:00
Olivier Goffart
d48c590346 Add animation-tick() builtin function
Low level primitive allowing to build always running animations
2022-07-11 17:49:28 +02:00
Olivier Goffart
b4ebd88d35 Implements @radial-gradient(circle, ...)
Only the circle is implemented so far.

Part of #263
2022-05-19 14:07:20 +02:00
Simon Hausmann
5a90d0dfa5 Rework the global singleton section in the language reference
Move the explanation of using two-way bindings to expose globals further
down.

Before that, provide inline examples with Rust and C++ how to access the
globals directly.
2022-04-13 17:01:03 +02:00
Olivier Goffart
54a6cb22ee Allow .darker and .brighter on Brush 2022-04-12 13:01:53 +02:00
Simon Hausmann
f1088611fb Rename slint,no_run into slint,no-preview for the code fence tags 2022-04-04 09:58:09 +02:00
Simon Hausmann
4c103b7a72 Fix the previews in the language reference
After commit 079a8a75d6 some previews
started having default 1024x768 winit sizes, which breaks.

Instead, assign preferred sizes and Window elements to all enabled
previews, and disable some where it doesn't make sense.
2022-04-04 09:58:09 +02:00
Simon Hausmann
ed5b76e7fc Improve syntax highlighting in the language reference
Highlight all Slint code and don't do the preview on snippets where it
doesn't make sense.

Some snippets, such as the bare statement or expression snippets, are
now highlighted, but they are continued to be excluded from the doctest.
2022-04-04 09:58:09 +02:00
Simon Hausmann
ab665b0007 Use new now SVG logo instead of the old SixtyFPS logo
In the online editor/preview as well as the doc preview.
2022-02-08 19:00:59 +01:00
Olivier Goffart
1425ef63de Change the Url from sixtyfps.io to slint-ui.com
Also, change the URL of the logo in the docs
2022-02-08 08:52:46 +01:00
Simon Hausmann
125b90a64b Merge remote-tracking branch 'origin/master' into wip/rename
Conflicts:
	api/cpp/cbindgen.rs
	api/cpp/include/slint.h
	examples/CMakeLists.txt
	examples/imagefilter/Cargo.toml
	examples/plotter/main.rs
	internal/backends/mcu/lib.rs
2022-02-04 16:47:20 +01:00
Tobias Hunger
b348d1af44 PropertyAnimation: Make iteration-count: n run animations n times
Side-effect: The code handles invalid inputs to duration/delay better.
2022-02-04 10:42:25 +01:00
Olivier Goffart
3594c20153 Replace SixtyFPS in many locations (Uppercase) 2022-02-02 15:49:18 +01:00
Olivier Goffart
692171bf0c Change the 60 blocks to slint blocs in documentation comments 2022-02-02 10:51:42 +01:00
Olivier Goffart
03534039d6 Replace more .60 by .slint
Mainly an automated change with
    git grep -O"sed -i 's/\.60/.slint/g'" -w "\.60"

and some manual checks
2022-02-02 10:12:31 +01:00
Olivier Goffart
d706d63ce1 Replace references to the .60 files that are now renamed with .slint 2022-02-02 10:12:31 +01:00
Olivier Goffart
0308f86cd4 Rename sixtyfps_widgets.60 to std-widgets.slint 2022-02-01 18:58:54 +01:00
Simon Hausmann
fa1ac9884d Verify the existence of imported custom fonts
... and produce diagnostics.

That way in later phases we don't need to check again.

As an unfortunately side-effect, we need to skip one of the examples in
the language reference from the doc test, as the compilation fails
because the font does not exist.
2022-01-19 16:24:22 +01:00
James Blacklock
7ad1ba209d Add support for array index expressions
This is a squash of the changes in
https://github.com/sixtyfpsui/sixtyfps/pull/605
2022-01-14 13:38:25 +01:00
Tobias Hunger
32cd9ccab2 Document delay property on PropertyAnimation 2022-01-11 20:58:26 +01:00
Simon Hausmann
eee5062e75 Small grammar fixes in the docs 2022-01-10 18:37:50 +01:00
Jared Moulton
c5c139fbc9
Feat: Add math funcs Log10, Log2, Log and Exp (#813)
Implement Math.log and Math.pow
2022-01-07 12:07:58 +01:00
Olivier Goffart
5891d006b1 Add a paragraph about when property are re-evaluated
As discussed in #769
2022-01-03 11:40:03 +01:00
Olivier Goffart
963c44fd78 Put the global functions also in the Math namespace
So they can be accessible even if there is a property of the same name
2021-12-08 16:35:11 +01:00
Olivier Goffart
0436ce2399 Allow to access color names form the Colors namespace 2021-12-08 16:35:11 +01:00
Olivier Goffart
efd0aee6ec
Docs: remove the wording about the limitation that length does not track the model
Was solved in #599
2021-10-20 15:29:15 +02:00
Olivier Goffart
6c677d13ac Document the new lenght properties on arrays
CC #580
2021-10-18 10:29:50 +02:00
Simon Hausmann
e3ce136106 Provide a modern introduction to the language reference 2021-10-13 10:38:05 +02:00
Simon Hausmann
db60a5c4e1 Provide a slightly simpler language reference intro sentence 2021-10-12 10:30:46 +02:00
Olivier Goffart
f0f264a94a Document the ternary operator
CC: https://github.com/sixtyfpsui/sixtyfps/discussions/562
2021-10-11 10:49:45 +02:00
Olivier Goffart
f2774a41a5 Document logical and comparison operators 2021-09-24 09:43:23 +02:00
Olivier Goffart
28932a32a5 Mention the bool type in the docs 2021-09-24 09:26:00 +02:00
Olivier Goffart
8d15bc1427 Parser: make the parentheses around if element optional
closes #466
2021-09-07 10:57:08 +02:00
Simon Hausmann
26a63fcf22 Change example docs of global exports to use a re-export
That's the more typical use-case to also deal with name spaces, where
this is done at import time.

The modified test case tries to ensure that this also works.
2021-08-27 13:38:57 +02:00
Simon Hausmann
85259b21b6 Provide an example of global exporting in the language reference 2021-08-27 13:36:48 +02:00
Olivier Goffart
b07d52cd23 Support aliases to callbacks in globals 2021-08-24 12:36:16 +02:00
Olivier Goffart
3b6b4442dd Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-08-10 22:21:01 +02:00
Olivier Goffart
8b2d1f1d8f Docs: replace underscores by dashes 2021-08-10 22:21:01 +02:00
Tobias Hunger
b347642f28 Fix typos, grammar and formatting issues in the docs 2021-08-08 11:06:58 +02:00
Simon Hausmann
317111ef2b Small drive-by typo fixes 2021-07-01 10:31:36 +02:00
Olivier Goffart
b5f2bbe8bb Mark code fragment as ignored in langref.md
With the nightly rust compiler, we include the langref.md in the
rust documentation, but we don't want these snippets to be understood
as rust code and tested
2021-06-30 09:23:57 +02:00
Tobias Hunger
e01bd87df8 Janitor: Fix warnings about markdown files
These might change the layout of the rendered markdown files. This will
also fix some typos along the way:-)
2021-06-28 08:32:25 +02:00
Tobias Hunger
13d7f5e7bd Janitor: Fix typos in comments and user-facing strings
Also adapt tests for error messages containing the fixed strings.

No behavior change is intended!
2021-06-28 08:32:25 +02:00
Olivier Goffart
99c140ae08 Allow accessing the width and height of the image in .60
Closes #208
2021-06-21 11:22:50 +02:00
Olivier Goffart
42c25248a8 Allow to give a name to for and if 2021-06-18 16:40:40 +02:00
Olivier Goffart
2483425d57 Add abs() 2021-06-11 14:17:47 +02:00
Olivier Goffart
ce34ff87d0 Finish support for callback aliases
cc #111
2021-06-07 20:40:36 +02:00
Olivier Goffart
6a4cd0087f Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-06-07 10:48:09 +02:00
Olivier Goffart
715d38903f Allow to omit the type of aliases 2021-06-07 10:48:09 +02:00