mirror of
https://github.com/slint-ui/slint.git
synced 2025-07-12 07:35:18 +00:00
Add increase/decrease support test (#5224)
This commit is contained in:
parent
7b3e2fcf32
commit
f63523f708
3 changed files with 66 additions and 0 deletions
|
@ -195,6 +195,44 @@ public:
|
|||
}
|
||||
}
|
||||
|
||||
/// Invokes the increase accessibility action of that element
|
||||
/// (`accessible-action-increment`).
|
||||
void invoke_accessible_increment_action() const
|
||||
{
|
||||
if (auto item = private_api::upgrade_item_weak(inner)) {
|
||||
union IncreaseActionHelper {
|
||||
cbindgen_private::AccessibilityAction action;
|
||||
IncreaseActionHelper()
|
||||
{
|
||||
action.tag = cbindgen_private::AccessibilityAction::Tag::Increment;
|
||||
}
|
||||
~IncreaseActionHelper() { }
|
||||
|
||||
} action;
|
||||
item->item_tree.vtable()->accessibility_action(item->item_tree.borrow(), item->index,
|
||||
&action.action);
|
||||
}
|
||||
}
|
||||
|
||||
/// Invokes the decrease accessibility action of that element
|
||||
/// (`accessible-action-decrement`).
|
||||
void invoke_accessible_decrement_action() const
|
||||
{
|
||||
if (auto item = private_api::upgrade_item_weak(inner)) {
|
||||
union DecreaseActionHelper {
|
||||
cbindgen_private::AccessibilityAction action;
|
||||
DecreaseActionHelper()
|
||||
{
|
||||
action.tag = cbindgen_private::AccessibilityAction::Tag::Decrement;
|
||||
}
|
||||
~DecreaseActionHelper() { }
|
||||
|
||||
} action;
|
||||
item->item_tree.vtable()->accessibility_action(item->item_tree.borrow(), item->index,
|
||||
&action.action);
|
||||
}
|
||||
}
|
||||
|
||||
/// Invokes the default accessibility action of that element
|
||||
/// (`accessible-action-default`).
|
||||
void invoke_accessible_default_action() const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue