Skip to content

Commit

Permalink
new widget.TabContainer is now container.AppTabs
Browse files Browse the repository at this point in the history
As per #1310
  • Loading branch information
andydotxyz committed Sep 22, 2020
1 parent ded5a51 commit 3207d86
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion cmd/fyne_demo/main.go
Expand Up @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne_demo/screens/container.go
Expand Up @@ -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()),
Expand Down
2 changes: 1 addition & 1 deletion cmd/fyne_demo/screens/widget.go
Expand Up @@ -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()),
Expand Down
11 changes: 6 additions & 5 deletions container/tabs.go
Expand Up @@ -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.
Expand All @@ -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...)
}

Expand Down

0 comments on commit 3207d86

Please sign in to comment.