forked from joejulian/gio
widget,widget/material: remove Color field from Icon
Icons are meant to be shared among multiple widgets, but their Color state may end up with unexpected values after use. Replace the state with and explicit argument to Layout. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -169,9 +169,8 @@ func (b IconButtonStyle) Layout(gtx layout.Context) layout.Dimensions {
|
||||
return b.Inset.Layout(gtx, func(gtx layout.Context) layout.Dimensions {
|
||||
size := gtx.Px(b.Size)
|
||||
if b.Icon != nil {
|
||||
b.Icon.Color = b.Color
|
||||
gtx.Constraints.Min = image.Point{X: size}
|
||||
b.Icon.Layout(gtx)
|
||||
b.Icon.Layout(gtx, b.Color)
|
||||
}
|
||||
return layout.Dimensions{
|
||||
Size: image.Point{X: size, Y: size},
|
||||
|
||||
Reference in New Issue
Block a user