From 6372fd93fd9c76b32d94df380b141e89fcfdd9b5 Mon Sep 17 00:00:00 2001 From: surtur Date: Wed, 25 May 2022 19:33:13 +0200 Subject: [PATCH] app: mv 'search' to a tab --- xkcdreader/app.go | 4 +--- xkcdreader/app_test.go | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/xkcdreader/app.go b/xkcdreader/app.go index 67c8bf7..604739f 100644 --- a/xkcdreader/app.go +++ b/xkcdreader/app.go @@ -63,9 +63,6 @@ func makeGreeting() *widget.Label { func makeToolbar() *widget.Toolbar { toolbar := widget.NewToolbar( - widget.NewToolbarAction(theme.SearchIcon(), func() { - log.Println("Search") - }), widget.NewToolbarSpacer(), widget.NewToolbarAction(theme.HelpIcon(), func() { log.Println("Display help") @@ -82,6 +79,7 @@ func makeTabs() *container.AppTabs { tabs := container.NewAppTabs( container.NewTabItem("xkcd comic", makeBrowseUI()), container.NewTabItem("what if?", widget.NewLabel("serious answers to absurd questions and absurd advice for common concerns from xkcd's Randall Munroe")), + container.NewTabItemWithIcon("search", theme.SearchIcon(), widget.NewEntry()), ) return tabs } diff --git a/xkcdreader/app_test.go b/xkcdreader/app_test.go index e2f94b5..d152bcc 100644 --- a/xkcdreader/app_test.go +++ b/xkcdreader/app_test.go @@ -19,7 +19,7 @@ func TestGreetingText(t *testing.T) { } func TestToolbar(t *testing.T) { - wantItems := 5 + wantItems := 4 gotToolbar := makeToolbar() if len(gotToolbar.Items) != wantItems {