Skip to content

Commit

Permalink
extend the base widget for toolbarActionButton
Browse files Browse the repository at this point in the history
  • Loading branch information
maruu committed Nov 8, 2023
1 parent 97ecd65 commit 4dc9db5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion widget/toolbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,12 @@ type toolbarActionButton struct {
t *ToolbarAction
}

func newToolbarActionButton(t *ToolbarAction) *toolbarActionButton {
b := &toolbarActionButton{t: t}
b.ExtendBaseWidget(b)
return b
}

func (b *toolbarActionButton) Refresh() {
b.Icon = b.t.Icon
b.OnTapped = b.t.OnActivated
Expand All @@ -40,7 +46,7 @@ type ToolbarAction struct {

// ToolbarObject gets a button to render this ToolbarAction
func (t *ToolbarAction) ToolbarObject() fyne.CanvasObject {
b := &toolbarActionButton{t: t}
b := newToolbarActionButton(t)
b.Refresh()
return b
}
Expand Down

0 comments on commit 4dc9db5

Please sign in to comment.