mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 22:54:36 +00:00
Change doc formatting of arguments in callbacks and functions
- Use a single code fence for the entire signature. Some where uses the one, some the other format. This unifies to the single fence that's easy to read and avoids extra visual boxes. - Removed names from arguments as that's not valid syntax at the moment.
This commit is contained in:
parent
50481e3387
commit
2b7aa6ba2d
7 changed files with 21 additions and 17 deletions
|
@ -186,8 +186,10 @@ or it will be mapped to a private unicode character. The mapping of these non-pr
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`key-pressed(`_[`KeyEvent`](structs.md#keyevent)_`) -> `[`EventResult`](enums.md#eventresult)**: Invoked when a key is pressed, the argument is a [`KeyEvent`](structs.md#keyevent) struct.
|
- **`key-pressed(KeyEvent) -> EventResult`**: Invoked when a key is pressed, the argument is a [`KeyEvent`](structs.md#keyevent) struct. The returned [`EventResult`](enums.md#eventresult) indicates whether to accept or ignore the event. Ignored events are
|
||||||
- **`key-released(`_[`KeyEvent`](structs.md#keyevent)_`) -> `[`EventResult`](enums.md#eventresult)**: Invoked when a key is released, the argument is a [`KeyEvent`](structs.md#keyevent) struct.
|
forwarded to the parent element.
|
||||||
|
- **`key-released(KeyEvent) -> EventResult`**: Invoked when a key is released, the argument is a [`KeyEvent`](structs.md#keyevent) struct. The returned [`EventResult`](enums.md#eventresult) indicates whether to accept or ignore the event. Ignored events are
|
||||||
|
forwarded to the parent element.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
@ -630,7 +632,8 @@ When not part of a layout, its width or height defaults to 100% of the parent el
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`accepted()`**: Invoked when enter key is pressed.
|
- **`accepted()`**: Invoked when enter key is pressed.
|
||||||
- **`cursor-position-changed(`[_`Point`_](structs.md#point)`)`**: The cursor was moved to the new (x, y) position.
|
- **`cursor-position-changed(Point)`**: The cursor was moved to the new (x, y) position
|
||||||
|
described by the [_`Point`_](structs.md#point) argument.
|
||||||
- **`edited()`**: Invoked when the text has changed because the user modified it.
|
- **`edited()`**: Invoked when the text has changed because the user modified it.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
@ -725,7 +728,8 @@ When not part of a layout, its width or height default to 100% of the parent ele
|
||||||
|
|
||||||
- **`clicked()`**: Invoked when clicked: The mouse is pressed, then released on this element.
|
- **`clicked()`**: Invoked when clicked: The mouse is pressed, then released on this element.
|
||||||
- **`moved()`**: The mouse has been moved. This will only be called if the mouse is also pressed.
|
- **`moved()`**: The mouse has been moved. This will only be called if the mouse is also pressed.
|
||||||
- **`pointer-event(`[_`PointerEvent`_](structs.md#pointerevent)`)`**: Invoked when a button was pressed or released.
|
- **`pointer-event(PointerEvent)`**: Invoked when a button was pressed or released The [_`PointerEvent`_](structs.md#pointerevent)
|
||||||
|
argument contains information such which button was pressed and any active keyboard modifiers.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ A button that, when clicked, opens a popup to select a value.
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`selected(`_`string`_`)`**: A value was selected from the combo box. The argument is the currently selected value.
|
- **`selected(string)`**: A value was selected from the combo box. The argument is the currently selected value.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
|
@ -26,8 +26,8 @@ a widget able to handle several lines of text.
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`accepted(`_`string`_`)`**: Enter was pressed
|
- **`accepted(string)`**: Enter was pressed
|
||||||
- **`edited(`_`string`_`)`**: Emitted when the text has changed because the user modified it
|
- **`edited(string)`**: Emitted when the text has changed because the user modified it
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`edited(`_`int`_`)`**: Emitted when the value has changed because the user modified it
|
- **`edited(int)`**: Emitted when the value has changed because the user modified it
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
|
@ -13,12 +13,12 @@ Same as [`ListView`](#listview), and in addition:
|
||||||
|
|
||||||
### Functions
|
### Functions
|
||||||
|
|
||||||
- **`set-current-item(`_`index: int`_`)`**: Sets the current item and brings it into view
|
- **`set-current-item(int)`**: Sets the current item by the specified index and brings it into view.
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`current-item-changed(`_`int`_`)`**: Emitted when the current item has changed because the user modified it
|
- **`current-item-changed(int)`**: Emitted when the current item has changed because the user modified it
|
||||||
- **`item-pointer-event(`_`index: int`_`, `_`event: PointerEvent`_`, `_`pos: Point`_`)`**: Emitted on any mouse pointer event similar to `TouchArea`. Arguments are item index associated with the event, the `PointerEvent` itself and the mouse position within the listview.
|
- **`item-pointer-event(int, PointerEvent, Point)`**: Emitted on any mouse pointer event similar to `TouchArea`. Arguments are item index associated with the event, the `PointerEvent` itself and the mouse position within the listview.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
|
@ -16,14 +16,14 @@ Same as [`ListView`](#listview), and in addition:
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`sort-ascending(`_`int`_`)`**: Emitted if the model should be sorted by the given column in ascending order.
|
- **`sort-ascending(int)`**: Emitted if the model should be sorted by the given column in ascending order.
|
||||||
- **`sort-descending(`_`int`_`)`**: Emitted if the model should be sorted by the given column in descending order.
|
- **`sort-descending(int)`**: Emitted if the model should be sorted by the given column in descending order.
|
||||||
- **`row-pointer-event(`_`index: int`_`, `_`event: PointerEvent`_`, `_`pos: Point`_`)`**: Emitted on any mouse pointer event similar to `TouchArea`. Arguments are row index associated with the event, the `PointerEvent` itself and the mouse position within the tableview.
|
- **`row-pointer-event(int, PointerEvent, Point)`**: Emitted on any mouse pointer event similar to `TouchArea`. Arguments are row index associated with the event, the `PointerEvent` itself and the mouse position within the tableview.
|
||||||
- **`current-row-changed(`_`int`_`)`**: Emitted when the current row has changed because the user modified it
|
- **`current-row-changed(int)`**: Emitted when the current row has changed because the user modified it
|
||||||
|
|
||||||
### Functions
|
### Functions
|
||||||
|
|
||||||
- **`set-current-row(index: int)`: Sets the current row and brings it into view
|
- **`set-current-row(int)`: Sets the current row by index and brings it into view.
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ shortcut will be implemented in a future version: <https://github.com/slint-ui/s
|
||||||
|
|
||||||
### Callbacks
|
### Callbacks
|
||||||
|
|
||||||
- **`edited(`_`string`_`)`**: Emitted when the text has changed because the user modified it
|
- **`edited(string)`**: Emitted when the text has changed because the user modified it
|
||||||
|
|
||||||
### Example
|
### Example
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue