mirror of
https://github.com/slint-ui/slint.git
synced 2025-07-12 07:35:18 +00:00
Add the accessible-action-expand
action
This commit is contained in:
parent
79b4950f41
commit
358e42a8d5
16 changed files with 75 additions and 3 deletions
|
@ -407,6 +407,27 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Invokes the expand accessibility action of that element
|
||||
/// (`accessible-action-expand`).
|
||||
void invoke_accessible_expand_action() const
|
||||
{
|
||||
if (inner.element_index != 0)
|
||||
return;
|
||||
if (auto item = private_api::upgrade_item_weak(inner.item)) {
|
||||
union ExpandActionHelper {
|
||||
cbindgen_private::AccessibilityAction action;
|
||||
ExpandActionHelper()
|
||||
{
|
||||
action.tag = cbindgen_private::AccessibilityAction::Tag::Expand;
|
||||
}
|
||||
~ExpandActionHelper() { }
|
||||
|
||||
} action;
|
||||
item->item_tree.vtable()->accessibility_action(item->item_tree.borrow(), item->index,
|
||||
&action.action);
|
||||
}
|
||||
}
|
||||
|
||||
/// Sets the accessible-value of that element.
|
||||
///
|
||||
/// Setting the value will invoke the `accessible-action-set-value` callback.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue