pub enum SemanticsRole {
Show 30 variants
Button,
CheckBox,
Slider,
TextInput,
TextRun,
Label,
Image,
Container,
Unknown,
Dialog,
Tab,
TabList,
TabPanel,
List,
ListItem,
ListOption,
Grid,
GridRow,
GridCell,
Tree,
TreeItem,
Progress,
Toast,
Menu,
MenuItem,
ComboBox,
RadioGroup,
RadioButton,
Tooltip,
Splitter,
}Expand description
语义角色 — 描述 Widget 在无障碍树中扮演什么
这是 mgui 自己的中间表示,避免 core crate 依赖 accesskit。
runtime crate 负责把它翻译成 accesskit::Role。
Variants§
Button
普通按钮(可聚焦 + 可 Click)
CheckBox
复选框(可聚焦 + 可 Toggle)
Slider
滑块(可聚焦 + 可 SetValue [0,1])
TextInput
单行文本输入(可聚焦 + 可 SetValue)
TextRun
文本运行(TextInput 的虚拟子节点;支持 SetTextSelection)
Label
纯文本标签(只读,通常不可聚焦)
Image
静态图片
Container
容器 — 聚合子节点的语义父节点
Unknown
未知/无意义 — 纯视觉装饰层,从无障碍树中隐藏
Dialog
模态/非模态对话框
Tab
页签
TabList
页签条容器
TabPanel
页签内容面板
List
列表容器
ListItem
列表项
ListOption
下拉/组合框选项
Grid
表格/网格
GridRow
表格行(虚拟子项用)
GridCell
表格单元格(虚拟子项用)
Tree
树
TreeItem
树节点
Progress
进度指示器
Toast
Toast / 通知(配合 live region)
Menu
弹出菜单容器
MenuItem
菜单项(可 Click)
ComboBox
下拉组合框(可 Click / 展开)
RadioGroup
单选组容器
RadioButton
单选按钮(可 Click)
Tooltip
工具提示气泡
Splitter
可拖动分隔条
Trait Implementations§
Source§impl Clone for SemanticsRole
impl Clone for SemanticsRole
impl Copy for SemanticsRole
Source§impl Debug for SemanticsRole
impl Debug for SemanticsRole
impl Eq for SemanticsRole
Source§impl PartialEq for SemanticsRole
impl PartialEq for SemanticsRole
impl StructuralPartialEq for SemanticsRole
Auto Trait Implementations§
impl Freeze for SemanticsRole
impl RefUnwindSafe for SemanticsRole
impl Send for SemanticsRole
impl Sync for SemanticsRole
impl Unpin for SemanticsRole
impl UnsafeUnpin for SemanticsRole
impl UnwindSafe for SemanticsRole
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more