Commit graph

123 commits

Author SHA1 Message Date
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
Olivier Goffart
ffeb5c50c0 Docs: consistently put the property type in italic 2022-07-06 09:53:06 +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
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
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
Simon Hausmann
0b9141c3d3 Apply suggestions from code review
Co-authored-by: Olivier Goffart <olivier.goffart@slint-ui.com>
2022-03-21 20:22:43 +01:00
Simon Hausmann
bef31d3169 Rename the layer boolean property to cache-rendering-hit 2022-03-21 20:22:43 +01:00
Simon Hausmann
535e134223 Add a Layer element that's created when using a layer boolean property
For now no backend implements this optimization hint.
2022-03-21 20:22:43 +01:00
Simon Hausmann
079a8a75d6 Fix sizes of some of the preview canvas elements in the docs
Don't fix the canvas to 100/100 physical pixels, as not all examples fit into that. Instead
let the GL backend resize according to constraints,
and add some missing sizes to some examples.
2022-03-21 16:53:30 +01:00
Jared Moulton
b884a4ca19 Fix CI issues, remove references to replace-char, add a test, fix creation of string 2022-03-02 15:47:32 +01:00
Jared Moulton
fdbc8056b3 Add an option to draw *'s instead of characters for password fields 2022-03-02 15:47:32 +01:00
Benedikt Werner
91a8cab42e Minor documentation fixes 2022-02-11 13:45:01 +01: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
Olivier Goffart
69908a32b6 Rename sixtyfps-viewer -> slint-viewer 2022-02-02 13:19:40 +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
0308f86cd4 Rename sixtyfps_widgets.60 to std-widgets.slint 2022-02-01 18:58:54 +01:00
Simon Hausmann
36e07b8801 Make it possible to use a string binding for Path commands
This was requested a few days ago in the chat and might also present an alternative for #754
2022-01-24 15:59:49 +01:00
Simon Hausmann
4f5df180b8 Add the named CSS colors to the docs 2022-01-21 16:33:34 +01:00
Simon Hausmann
ad20d44e33 Document the values in the Keys namespace 2022-01-21 16:33:34 +01:00
Simon Hausmann
113bdb8730 doc: add missing period at the end of the sentence 2022-01-20 13:47:11 +01:00
Olivier Goffart
cdfac0574b
Fix typo 2022-01-02 20:38:36 +01:00
Frederick Vollbrecht
12c0ef38fb
Typos: repeating words in documentation, across the repository (#753)
* fixed typo in image.rs

* unnecessary repeated words in sixtyfps_runtime

* unnecessary repeated words in sixtyfps_compiler

* unnecessary repeated word in docs

* unnecessary repeated words in helper_crates
2021-12-19 17:40:45 +01:00
Olivier Goffart
df22b65107 Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-12-10 11:28:09 +01:00
Olivier Goffart
f7c92183db Add a Keys namespace in the .60 language with all the string constant for special keys 2021-12-10 11:28:09 +01:00
Lukas Jung
70d71e7c59 Add documentation for mouse-cursor 2021-12-07 22:41:24 +01:00
Olivier Goffart
0e5295aa33 Some more improvments to the Flickable docs
Complete #716
2021-12-06 12:08:20 +01:00
Jared Moulton
63fd204dda Update the Flickable and ScrollView docs...
...to include mention that the default is for the viewport dimensions to
be calculated automatically and add properties and and an example to the
Flickable docs
2021-12-06 11:59:09 +01:00
Jared Moulton
a3c0771a2a Update Flickable and ScrollView docs...
...to include information about having to manually set the
viewport-width and viewport-height when using a for loop to instantiate
elements.
2021-12-06 11:59:09 +01:00
Robert Broketa
c3c7765f80 Add no-frame property for a borderless/frameless window 2021-10-11 10:21:21 +02:00
Olivier Goffart
ae3e1b4680 Allow normal Element to be in the Dialog's button row with dialog-button-role 2021-10-05 09:46:20 +02:00
Olivier Goffart
2716e4b4dd TouchArea: add the pointer-event callback
... instead of `pressed-changed`

This allows to see what mouse button was pressed.

Closes #535
2021-10-04 14:39:49 +02:00
Olivier Goffart
0aecece4ef Add moved and pressed-changed callback to TouchArea 2021-10-01 14:53:25 +02:00
Olivier Goffart
7db9f3dfa9 Dialog: automatically add clicked callback for the standard button
And make the viewer listen to them and set them to automatically close dialogs
2021-09-30 10:21:13 +02:00
Olivier Goffart
9936dfc0eb Apply suggestions from code review
Co-authored-by: Simon Hausmann <simon.hausmann@sixtyfps.io>
2021-09-29 16:25:44 +02:00
Olivier Goffart
7f05bfa309 Add the Dialog element 2021-09-29 16:25:44 +02:00
Jocelyn Turcotte
8558c1976e Docs: Fix TouchArea's pressed-y 2021-09-11 17:20:18 +02:00
Ryan Van Gilder
80b230bdf1 Add image-rendering documentation 2021-09-06 10:03:51 +02:00
Olivier Goffart
4f1eacd6d8 LineEdit is now able to scroll to keep the cursor visible 2021-09-02 17:20:44 +02:00
Olivier Goffart
b2392c25c7 Basic support for Multi-line TextInput 2021-09-01 16:52:37 +02:00
Simon Hausmann
cdca921469 Apply the default text color from the style for the color of Text and TextInput elements
We apply a default window background from the palette to all `Window`
elements, and likewise we need to apply the default text color to Text
elements to ensure a readable contrast.

This also fixes the default text color when using Qt/native style in
dark mode on macOS.
2021-08-23 15:03:18 +02:00
Tobias Hunger
aea4ecca99 Apply pre-commit hooks to all files 2021-08-17 22:38:16 +02:00
Olivier Goffart
8b2d1f1d8f Docs: replace underscores by dashes 2021-08-10 22:21:01 +02:00
Simon Hausmann
55056aec3b doc: Remove mention of the Clip element, as it has been replaced with a clip: true on a Rectangle a while ago 2021-08-09 13:06:59 +02:00
Tobias Hunger
b347642f28 Fix typos, grammar and formatting issues in the docs 2021-08-08 11:06:58 +02:00
Jocelyn Turcotte
85e2cfa54a Mention forward-focus in the FocusScope example
This makes the example a bit more useful out of the box,
at least to let the user know that this property exists.
2021-08-01 10:42:34 +02:00
Olivier Goffart
b0b3912c27 Add support for the visible property 2021-07-29 15:02:25 +02:00
Olivier Goffart
bd52f4d444 Allow the clip property to be a dynamic property 2021-07-29 15:02:25 +02:00