File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -314,11 +314,15 @@ impl Widget for Button<'_> {
314
314
315
315
let ( rect, mut response) = ui. allocate_at_least ( desired_size, sense) ;
316
316
response. widget_info ( || {
317
+ let mut widget_info = WidgetInfo :: new ( WidgetType :: Button ) ;
318
+ widget_info. enabled = ui. is_enabled ( ) ;
319
+
317
320
if let Some ( galley) = & galley {
318
- WidgetInfo :: labeled ( WidgetType :: Button , ui . is_enabled ( ) , galley. text ( ) )
319
- } else {
320
- WidgetInfo :: new ( WidgetType :: Button )
321
+ widget_info . label = Some ( galley. text ( ) . to_owned ( ) ) ;
322
+ } else if let Some ( image ) = & image {
323
+ widget_info . label = image . alt_text . clone ( ) ;
321
324
}
325
+ widget_info
322
326
} ) ;
323
327
324
328
if ui. is_rect_visible ( rect) {
Original file line number Diff line number Diff line change @@ -54,7 +54,7 @@ pub struct Image<'a> {
54
54
sense : Sense ,
55
55
size : ImageSize ,
56
56
pub ( crate ) show_loading_spinner : Option < bool > ,
57
- alt_text : Option < String > ,
57
+ pub ( crate ) alt_text : Option < String > ,
58
58
}
59
59
60
60
impl < ' a > Image < ' a > {
You can’t perform that action at this time.
0 commit comments