@@ -83,7 +83,7 @@ func (a *actionGroup) setActions(actions []AppBarAction, overflows []OverflowAct
8383 a .overflowState = make ([]widget.Clickable , len (a .actions )+ len (a .overflow ))
8484}
8585
86- func (a * actionGroup ) layout (gtx C , th * material.Theme , overflowBtn * widget.Clickable ) D {
86+ func (a * actionGroup ) layout (gtx C , th * material.Theme , overflowBtn * widget.Clickable , overflowDesc string ) D {
8787 overflowedActions := len (a .actions )
8888 gtx .Constraints .Min .Y = 0
8989 widthDp := float32 (gtx .Constraints .Max .X ) / gtx .Metric .PxPerDp
@@ -114,7 +114,7 @@ func (a *actionGroup) layout(gtx C, th *material.Theme, overflowBtn *widget.Clic
114114 if len (a .overflow )+ overflowedActions > 0 {
115115 actions = append (actions , layout .Rigid (func (gtx C ) D {
116116 gtx .Constraints .Min .Y = gtx .Constraints .Max .Y
117- btn := material .IconButton (th , overflowBtn , moreIcon )
117+ btn := material .IconButton (th , overflowBtn , moreIcon , overflowDesc )
118118 btn .Size = unit .Dp (24 )
119119 btn .Background = th .Palette .Bg
120120 btn .Color = th .Palette .Fg
@@ -366,8 +366,11 @@ func SwapPairs(p material.Palette) material.Palette {
366366}
367367
368368// Layout renders the app bar. It will span all available horizontal
369- // space (gtx.Constraints.Max.X), but has a fixed height.
370- func (a * AppBar ) Layout (gtx layout.Context , theme * material.Theme ) layout.Dimensions {
369+ // space (gtx.Constraints.Max.X), but has a fixed height. The navDesc
370+ // is an accessibility description for the navigation icon button, and
371+ // the overflowDesc is an accessibility description for the overflow
372+ // action button.
373+ func (a * AppBar ) Layout (gtx layout.Context , theme * material.Theme , navDesc , overflowDesc string ) layout.Dimensions {
371374 a .initialize ()
372375 gtx .Constraints .Max .Y = gtx .Px (unit .Dp (56 ))
373376 th := * theme
@@ -403,7 +406,7 @@ func (a *AppBar) Layout(gtx layout.Context, theme *material.Theme) layout.Dimens
403406 if a .contextualAnim .Visible () {
404407 icon = cancelIcon
405408 }
406- button := material .IconButton (& th , & a .NavigationButton , icon )
409+ button := material .IconButton (& th , & a .NavigationButton , icon , navDesc )
407410 button .Size = unit .Dp (24 )
408411 button .Background = th .Palette .Bg
409412 button .Color = th .Fg
@@ -424,7 +427,7 @@ func (a *AppBar) Layout(gtx layout.Context, theme *material.Theme) layout.Dimens
424427 layout .Flexed (1 , func (gtx C ) D {
425428 gtx .Constraints .Min .Y = gtx .Constraints .Max .Y
426429 return layout .E .Layout (gtx , func (gtx C ) D {
427- return actionSet .layout (gtx , & th , & a .overflowMenu .Clickable )
430+ return actionSet .layout (gtx , & th , & a .overflowMenu .Clickable , overflowDesc )
428431 })
429432 }),
430433 )
0 commit comments