Commit graph

493 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
Tobias Hunger
20c1c45253
Button: Implement support to make the Button a toggle (#1384)
Add flags that enable the Button to be used as a Toggle, e.g. for use in toolbars or similar places.

Co-authored-by: Simon Hausmann <hausmann@gmail.com>
2022-07-08 16:17:06 +02:00
aydwi
dafbcc8418 Update recipes.md
Fix a small namespace bug in C++ sample code for "Global Callbacks"
2022-07-06 21:53:54 +02:00
ogoffart
6b15d2e479 Bump version number to 0.2.6 2022-07-06 09:58:14 +00:00
Olivier Goffart
4a6de71c59 Revert "Change doc URL for the release"
This reverts commit 0ddca89f3b.

The release is done, go back to master
2022-07-06 11:54:09 +02:00
Olivier Goffart
8dfec21b30 docs: Actually fix md links containing anchors 2022-07-06 10:10:20 +02:00
Olivier Goffart
ffeb5c50c0 Docs: consistently put the property type in italic 2022-07-06 09:53:06 +02:00
Olivier Goffart
9f78674124 Fix links to enums in the docs
The JS was fixing links to `*.md` files, but not `*.md#foo`
2022-07-06 09:39:54 +02:00
Olivier Goffart
0ddca89f3b Change doc URL for the release 2022-07-06 09:32:32 +02:00
Olivier Goffart
6334bc433b Update version in docs 2022-07-06 09:31:30 +02:00
Tobias Hunger
07ad20a09c
Basic Slint accessibility support (#1294)
Implement basic accessibility (a11y) support, using the Qt backend.

_This should get us started, but accessibility support is an additional way to interact with UIs that is very different from the "graphical way" most users will interact with the UI. No single PR will "make a toolkit accessibility", this needs to be an ongoing effort!_

Parts of this PR:

* Add functions to access a11y-related properties to Component
* Add helper functions to Item struct 
* Handle accessible- properties in the compiler
* Add documentation, add description, enforce some basic rules
* Make the Text element accessible by default
* Don't optimize away accessibility property in the LLR
* Ensure that accessibility property are marked as used
* Add some accessibility properties to the native style widgets
* Support for bool and integer `accessible` properties
* Implement basic support for accessibility
* Make basic widgets accessible by default
* Make slider focus-able and interactable with keyboard
* Tell a11y layer about value changes
* Generate QAccessible constants using bindgen
* Don't expose the `accessible` properties when using the MCU backend: There is no backend to make use of them
* Handle focus change based on keyboard focus of the window
* Report accessible widgets at correct positions
* Allow for (virtual) focus delegation at the a11y level
* Calculate value step size dynamically
* Make sure to not send notifications to a11y backend about dead objects
2022-06-08 20:42:10 +02:00
pubg-hacks
aed71311ca Add a read-only propery to TextInput, LineEdit and TextEdit 2022-06-08 09:23:01 +02:00
Tobias Hunger
18cbda0269 janitor: Run cargo clippy --fix 2022-05-22 11:59:00 +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
Olivier Goffart
1e8f44b81a Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-05-13 13:15:51 +02:00
Olivier Goffart
9fa59d38cd Generate the enum documentation based of the common/enums.rs
So that makes it harder to forget to update the docs

Note that the new builtin_enums.md does not contain a `### Values`
section header anymore. Also some enum where documented with the full
enum value (such as `TextHorizontalAlignment.left`) while now this
is omitted

The CI should fail if one forget to run `cargo xtask enumdocs` after
adding an enum or changing the docs
2022-05-13 13:15:51 +02:00
ogoffart
3709ded44d Bump version number to 0.2.5 2022-05-09 16:16:00 +00:00
Olivier Goffart
c82cd24f36 Revert "slint-docs-preview.html: adjust URL for the release"
This reverts commit a621365468.
2022-05-09 18:14:51 +02:00
Olivier Goffart
a621365468 slint-docs-preview.html: adjust URL for the release 2022-05-09 17:33:59 +02:00
Olivier Goffart
d6ec32ee5f Prepare the 0.2.4 release 2022-05-09 17:32:37 +02:00
ogoffart
c160ec2aef Bump version number to 0.2.4 2022-05-09 13:49:25 +00:00
Olivier Goffart
3e2f4a60ba Revert "slint-docs-preview.html: Update URL for the release"
This reverts commit c1b6ac258b.
2022-05-09 15:48:31 +02:00
Olivier Goffart
c1b6ac258b slint-docs-preview.html: Update URL for the release 2022-05-09 14:52:10 +02:00
Olivier Goffart
e999ecd444 Update version number in docs 2022-05-09 14:49:53 +02:00
ogoffart
6395cdfc09 Bump version number to 0.2.3 2022-05-04 12:32:58 +00:00
Olivier Goffart
ed7eb6f540 Revert "Update URL in docs for release"
This reverts commit 79a1bd5d6e.

Release is done 🎉
2022-05-04 13:53:31 +02:00
Olivier Goffart
79a1bd5d6e Update URL in docs for release 2022-05-04 12:02:36 +02:00
Olivier Goffart
69a2d45203 Update version number in docs and readme 2022-05-04 12:00:57 +02:00
Tobias Hunger
894ee5aa91
Do not build node by default (#1210)
Having to make sure the right version of npm is installed is a hassle
for people that just want to try out slint for the first time. The
proposed way to disable node support enables basically everything else,
which opens another can of worms when Windows tries to build MCU
support.

So do not build Node.JS as part of the default build anymore, but
document how to build it.

The CI should build with `--workspace` already, so there should be no
need to change the CI build.
2022-05-02 13:30:19 +02:00
Olivier Goffart
f75a0d4e0f
Recipes: Slider and Tabs 2022-04-20 18:03:40 +02:00
Olivier Goffart
dee7d9c556 Documentation: add a edit link to .slint snippet that open the code editor 2022-04-20 16:49:05 +02:00
Olivier Goffart
ca5bfd3426 Doc recipes: add custom widgets 2022-04-19 17:11:20 +02:00
Olivier Goffart
452bc2a696 Update MSRV to rust 1.59 in the CI and documentation
This is only required for dependencies of slint-build and xtask.
So this is not enforced yet and will still work with 1.56 with
for C++ or when not using slint-build.
2022-04-14 19:18:05 +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
dd3d738774 C++ test: use the libslint_cpp.so from the deps folder
For some reason, The cargo test for the cpp driver test puts the
libslint_cpp.so library in the `deps` foilder, in addition to the
cdynlib which is generated in the normal target folder. So we end
up with two .so.

We need to have the cpp lib as a dependency because its metadata give us the
metadata on where to find the headers.
Ideally it should be an artifact dependency but this is not yet existing

Since cargo sets the LD_LIBRARY_PATH or the PATH env variable when
running the test, running the runtime built binaries work by taking
the library that is in the deps folder.
2022-04-13 10:37:37 +02:00
Olivier Goffart
54a6cb22ee Allow .darker and .brighter on Brush 2022-04-12 13:01:53 +02:00
Olivier Goffart
40c98d6d05 Update cbindgen and enable MouseCursor::move
cbindgen 0.21 was released which contains https://github.com/eqrion/cbindgen/pull/724
which allow to use raw identifier in enums shared with C++.
So now we can have `MouseCursor.move` in slint  despite it being a rust keyword

Note that the strum macro also have trouble with the raw identifier, so we
take that in account in the conversion functions in the interpreter
2022-04-05 06:39:50 +02:00
Olivier Goffart
c24a51aaba Apply suggestions from code review
grammar and wording fixes

Co-authored-by: Simon Hausmann <simon.hausmann@slint-ui.com>
2022-04-05 06:39:21 +02:00
Olivier Goffart
7979d54c85 Recipes: Add some text to fill it 2022-04-05 06:39:21 +02:00
Simon Hausmann
72cf11b855 Adapt to correct no-preview code fence syntax 2022-04-04 10:01:26 +02:00
Simon Hausmann
87d66d0e53 Fix the compilation of the global callback example recipe 2022-04-04 10:01:26 +02:00
Simon Hausmann
f1e7f876f9 Make the showing/hiding of language snippets explicit in the markup
Use a data attribute instead of relying on the structure of rustdoc and myst-parser/sphinx.
2022-04-04 10:01:26 +02:00
Simon Hausmann
2e9fc34af3 Don't run the global callback example as preview 2022-04-04 10:01:26 +02:00
Simon Hausmann
809b29a422 Added example of invoking a global callback 2022-04-04 10:01:26 +02:00
Simon Hausmann
1eaee7809d Show/hide the language specific example blocks in the recipes 2022-04-04 10:01:26 +02:00
Simon Hausmann
f88b9f143e Fix doctest
Make the native Rust example compile
2022-04-04 10:01:26 +02:00
Simon Hausmann
4c88b2b19b Start a page with examples and recipes
This is the beginning of a page to collect common things users need to
do, in a format that they can copy & paste into their application code.

There's a lot more that could be done though.
2022-04-04 10:01:26 +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