From 3207d863573e9a9922f8a00fd092ec57d56eab26 Mon Sep 17 00:00:00 2001 From: Andy Williams Date: Tue, 22 Sep 2020 16:54:00 +0100 Subject: [PATCH] new widget.TabContainer is now container.AppTabs As per #1310 --- cmd/fyne_demo/main.go | 2 +- cmd/fyne_demo/screens/container.go | 2 +- cmd/fyne_demo/screens/widget.go | 2 +- container/tabs.go | 11 ++++++----- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/cmd/fyne_demo/main.go b/cmd/fyne_demo/main.go index bb63e77e4b..be3743da2d 100644 --- a/cmd/fyne_demo/main.go +++ b/cmd/fyne_demo/main.go @@ -115,7 +115,7 @@ func main() { w.SetMainMenu(mainMenu) w.SetMaster() - tabs := container.NewTabs( + tabs := container.NewAppTabs( container.NewTabItemWithIcon("Welcome", theme.HomeIcon(), welcomeScreen(a)), container.NewTabItemWithIcon("Graphics", theme.DocumentCreateIcon(), screens.GraphicsScreen()), container.NewTabItemWithIcon("Widgets", theme.CheckButtonCheckedIcon(), screens.WidgetScreen()), diff --git a/cmd/fyne_demo/screens/container.go b/cmd/fyne_demo/screens/container.go index 8723053192..23f130fa02 100644 --- a/cmd/fyne_demo/screens/container.go +++ b/cmd/fyne_demo/screens/container.go @@ -14,7 +14,7 @@ import ( // ContainerScreen loads a tab panel for containers and layouts func ContainerScreen() fyne.CanvasObject { - return container.NewTabs( + return container.NewAppTabs( // TODO not best use of tabs here either container.NewTabItem("Accordion", makeAccordionTab()), container.NewTabItem("Card", makeCardTab()), container.NewTabItem("Split", makeSplitTab()), diff --git a/cmd/fyne_demo/screens/widget.go b/cmd/fyne_demo/screens/widget.go index f2c17838ee..c35e30a8da 100644 --- a/cmd/fyne_demo/screens/widget.go +++ b/cmd/fyne_demo/screens/widget.go @@ -330,7 +330,7 @@ func WidgetScreen() fyne.CanvasObject { ) progress := makeProgressTab() - tabs := container.NewTabs( + tabs := container.NewAppTabs( // TODO move to something better suited to this content container.NewTabItem("Buttons", makeButtonTab()), container.NewTabItem("Text", makeTextTab()), container.NewTabItem("Input", makeInputTab()), diff --git a/container/tabs.go b/container/tabs.go index c7d8513eb5..1ef4aa57cc 100644 --- a/container/tabs.go +++ b/container/tabs.go @@ -5,9 +5,10 @@ import ( "fyne.io/fyne/widget" ) -// Tabs container allows switching visible content from a list of TabItems. -// Each item is represented by a button at the top of the widget. -type Tabs = widget.TabContainer +// AppTabs container is used to split your application into various different areas identified by tabs. +// The tabs contain text and/or an icon and allow the user to switch between the content specified in each TabItem. +// Each item is represented by a button at the edge of the container. +type AppTabs = widget.TabContainer // TabItem represents a single view in a TabContainer. // The Text and Icon are used for the tab button and the Content is shown when the corresponding tab is active. @@ -24,8 +25,8 @@ const ( TabLocationTrailing ) -// NewTabs creates a new tab bar widget that allows the user to choose between different visible containers -func NewTabs(items ...*TabItem) *Tabs { +// NewAppTabs creates a new tab container that allows the user to choose between different areas of an app. +func NewAppTabs(items ...*TabItem) *AppTabs { return widget.NewTabContainer(items...) }