From 4dc9db5a230cf2cc0f6a5b86a5ea190a63535923 Mon Sep 17 00:00:00 2001 From: maruu <> Date: Tue, 31 Oct 2023 07:33:29 +0000 Subject: [PATCH] extend the base widget for toolbarActionButton --- widget/toolbar.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/widget/toolbar.go b/widget/toolbar.go index 5452491f9a..99e883c3be 100644 --- a/widget/toolbar.go +++ b/widget/toolbar.go @@ -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 @@ -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 }