mirror of
https://github.com/slint-ui/slint.git
synced 2025-08-04 02:39:28 +00:00
Allow to check checkable support (#5186)
This commit is contained in:
parent
afa295a511
commit
f8f3316dc1
3 changed files with 29 additions and 0 deletions
|
@ -105,6 +105,23 @@ public:
|
|||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// Returns the accessible-checkable of that element, if any.
|
||||
std::optional<bool> accessible_checkable() const
|
||||
{
|
||||
if (auto item = private_api::upgrade_item_weak(inner)) {
|
||||
SharedString result;
|
||||
if (item->item_tree.vtable()->accessible_string_property(
|
||||
item->item_tree.borrow(), item->index,
|
||||
cbindgen_private::AccessibleStringProperty::Checkable, &result)) {
|
||||
if (result == "true")
|
||||
return true;
|
||||
else if (result == "false")
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
/// 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