@@ -213,6 +213,7 @@ impl TestingClient {
213
213
accessible_checkable : element. accessible_checkable ( ) . unwrap_or_default ( ) ,
214
214
size : send_logical_size ( element. size ( ) ) . into ( ) ,
215
215
absolute_position : send_logical_position ( element. absolute_position ( ) ) . into ( ) ,
216
+ accessible_role : convert_accessible_role ( element. accessible_role ( ) . unwrap ( ) ) ,
216
217
} )
217
218
}
218
219
@@ -338,3 +339,26 @@ fn send_logical_size(sz: i_slint_core::api::LogicalSize) -> proto::LogicalSize {
338
339
fn send_logical_position ( pos : i_slint_core:: api:: LogicalPosition ) -> proto:: LogicalPosition {
339
340
proto:: LogicalPosition { x : pos. x , y : pos. y }
340
341
}
342
+
343
+ fn convert_accessible_role ( role : i_slint_core:: items:: AccessibleRole ) -> proto:: AccessibleRole {
344
+ match role {
345
+ i_slint_core:: items:: AccessibleRole :: None => proto:: AccessibleRole :: Unknown ,
346
+ i_slint_core:: items:: AccessibleRole :: Button => proto:: AccessibleRole :: Button ,
347
+ i_slint_core:: items:: AccessibleRole :: Checkbox => proto:: AccessibleRole :: Checkbox ,
348
+ i_slint_core:: items:: AccessibleRole :: Combobox => proto:: AccessibleRole :: Combobox ,
349
+ i_slint_core:: items:: AccessibleRole :: List => proto:: AccessibleRole :: List ,
350
+ i_slint_core:: items:: AccessibleRole :: Slider => proto:: AccessibleRole :: Slider ,
351
+ i_slint_core:: items:: AccessibleRole :: Spinbox => proto:: AccessibleRole :: Spinbox ,
352
+ i_slint_core:: items:: AccessibleRole :: Tab => proto:: AccessibleRole :: Tab ,
353
+ i_slint_core:: items:: AccessibleRole :: TabList => proto:: AccessibleRole :: TabList ,
354
+ i_slint_core:: items:: AccessibleRole :: Text => proto:: AccessibleRole :: Text ,
355
+ i_slint_core:: items:: AccessibleRole :: Table => proto:: AccessibleRole :: Table ,
356
+ i_slint_core:: items:: AccessibleRole :: Tree => proto:: AccessibleRole :: Tree ,
357
+ i_slint_core:: items:: AccessibleRole :: ProgressIndicator => {
358
+ proto:: AccessibleRole :: ProgressIndicator
359
+ }
360
+ i_slint_core:: items:: AccessibleRole :: TextInput => proto:: AccessibleRole :: TextInput ,
361
+ i_slint_core:: items:: AccessibleRole :: Switch => proto:: AccessibleRole :: Switch ,
362
+ _ => proto:: AccessibleRole :: Unknown ,
363
+ }
364
+ }
0 commit comments