use crate::{AccessActionKind as Kind, AccessNode, Id};
pub(super) fn trigger(node: &mut AccessNode, id: Id, label: &str, enabled: bool) {
node.label(label)
.disabled(!enabled)
.has_popup()
.clicks(id)
.action(Kind::Expand)
.action(Kind::Collapse)
.action(Kind::SetValue);
}
pub(super) fn trigger_state(
node: &mut AccessNode,
value: Option<&str>,
placeholder: &str,
open: bool,
invalid: bool,
) {
match value {
Some(label) => node.value(label),
None => node.placeholder(placeholder),
};
node.expanded(open).invalid(invalid);
}
pub(super) fn popup_owner(node: &mut AccessNode, combo: Id, list: Id, active: Option<Id>) {
node.controls(list);
if let Some(option) = active {
node.active_descendant(combo.with(("option", option)));
}
}