diff --git a/container/doctabs.go b/container/doctabs.go index cb276f6b91..b1bcf468e3 100644 --- a/container/doctabs.go +++ b/container/doctabs.go @@ -319,18 +319,7 @@ func (r *docTabsRenderer) buildTabButtons(count int, buttons *fyne.Container) { buttons.Objects = nil var iconPos buttonIconPosition - if fyne.CurrentDevice().IsMobile() { - cells := count - if cells == 0 { - cells = 1 - } - if r.docTabs.location == TabLocationTop || r.docTabs.location == TabLocationBottom { - buttons.Layout = layout.NewGridLayoutWithColumns(cells) - } else { - buttons.Layout = layout.NewGridLayoutWithRows(cells) - } - iconPos = buttonIconTop - } else if r.docTabs.location == TabLocationLeading || r.docTabs.location == TabLocationTrailing { + if r.docTabs.location == TabLocationLeading || r.docTabs.location == TabLocationTrailing { buttons.Layout = layout.NewVBoxLayout() iconPos = buttonIconTop } else { diff --git a/container/doctabs_mobile_test.go b/container/doctabs_mobile_test.go index 10f761e383..034c3ed9cf 100644 --- a/container/doctabs_mobile_test.go +++ b/container/doctabs_mobile_test.go @@ -347,11 +347,11 @@ func TestDocTabs_Tapped(t *testing.T) { require.Equal(t, 0, tabs.SelectedIndex()) test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_first_selected.xml", c) - test.TapCanvas(c, fyne.NewPos(120, 10)) + test.TapCanvas(c, fyne.NewPos(100, 10)) assert.Equal(t, 1, tabs.SelectedIndex()) test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_second_selected.xml", c) - test.TapCanvas(c, fyne.NewPos(240, 10)) + test.TapCanvas(c, fyne.NewPos(180, 10)) assert.Equal(t, 2, tabs.SelectedIndex()) test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_third_selected.xml", c) @@ -359,7 +359,7 @@ func TestDocTabs_Tapped(t *testing.T) { require.Equal(t, 0, tabs.SelectedIndex()) test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_first_selected.xml", c) - test.TapCanvas(c, fyne.NewPos(330, 10)) + test.TapCanvas(c, fyne.NewPos(320, 10)) require.Equal(t, 3, tabs.SelectedIndex()) test.AssertRendersToMarkup(t, "doctabs/mobile/tapped_create_tab.xml", c) diff --git a/container/testdata/doctabs/mobile/change_content_change_hidden.xml b/container/testdata/doctabs/mobile/change_content_change_hidden.xml index 300aea2165..3dd8a4f83b 100644 --- a/container/testdata/doctabs/mobile/change_content_change_hidden.xml +++ b/container/testdata/doctabs/mobile/change_content_change_hidden.xml @@ -3,16 +3,16 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text3 diff --git a/container/testdata/doctabs/mobile/change_content_change_visible.xml b/container/testdata/doctabs/mobile/change_content_change_visible.xml index 300aea2165..3dd8a4f83b 100644 --- a/container/testdata/doctabs/mobile/change_content_change_visible.xml +++ b/container/testdata/doctabs/mobile/change_content_change_visible.xml @@ -3,16 +3,16 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text3 diff --git a/container/testdata/doctabs/mobile/change_content_initial.xml b/container/testdata/doctabs/mobile/change_content_initial.xml index 9f24e17f28..1b5b1aa832 100644 --- a/container/testdata/doctabs/mobile/change_content_initial.xml +++ b/container/testdata/doctabs/mobile/change_content_initial.xml @@ -3,16 +3,16 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text1 diff --git a/container/testdata/doctabs/mobile/change_icon_change_selected.xml b/container/testdata/doctabs/mobile/change_icon_change_selected.xml index e0456fcfc3..bd61382688 100644 --- a/container/testdata/doctabs/mobile/change_icon_change_selected.xml +++ b/container/testdata/doctabs/mobile/change_icon_change_selected.xml @@ -1,42 +1,34 @@ - - - - - + + + + + - + - - + + - + - - - - - - - - - - - - - + + + + + - - - + + + Text1 diff --git a/container/testdata/doctabs/mobile/change_icon_change_unselected.xml b/container/testdata/doctabs/mobile/change_icon_change_unselected.xml index d3123d2712..79530754a1 100644 --- a/container/testdata/doctabs/mobile/change_icon_change_unselected.xml +++ b/container/testdata/doctabs/mobile/change_icon_change_unselected.xml @@ -1,42 +1,34 @@ - - - - - + + + + + - + - - + + - + - - - - - - - - - - - - - + + + + + - - - + + + Text1 diff --git a/container/testdata/doctabs/mobile/change_icon_initial.xml b/container/testdata/doctabs/mobile/change_icon_initial.xml index 8777680652..aecf735ec1 100644 --- a/container/testdata/doctabs/mobile/change_icon_initial.xml +++ b/container/testdata/doctabs/mobile/change_icon_initial.xml @@ -1,42 +1,34 @@ - - - - - + + + + + - + - - + + - + - - - - - - - - - - - - - + + + + + - - - + + + Text1 diff --git a/container/testdata/doctabs/mobile/change_label_change_selected.xml b/container/testdata/doctabs/mobile/change_label_change_selected.xml index 63a6859578..4677f3fea7 100644 --- a/container/testdata/doctabs/mobile/change_label_change_selected.xml +++ b/container/testdata/doctabs/mobile/change_label_change_selected.xml @@ -3,16 +3,16 @@ - - - New 1 - + + + New 1 + - - Test2 - + + Test2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text1 diff --git a/container/testdata/doctabs/mobile/change_label_change_unselected.xml b/container/testdata/doctabs/mobile/change_label_change_unselected.xml index 11b5e1d393..7bb1918d7d 100644 --- a/container/testdata/doctabs/mobile/change_label_change_unselected.xml +++ b/container/testdata/doctabs/mobile/change_label_change_unselected.xml @@ -3,16 +3,16 @@ - - - New 1 - + + + New 1 + - - New 2 - + + New 2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text1 diff --git a/container/testdata/doctabs/mobile/change_label_initial.xml b/container/testdata/doctabs/mobile/change_label_initial.xml index 9f24e17f28..1b5b1aa832 100644 --- a/container/testdata/doctabs/mobile/change_label_initial.xml +++ b/container/testdata/doctabs/mobile/change_label_initial.xml @@ -3,16 +3,16 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text1 diff --git a/container/testdata/doctabs/mobile/dynamic_appended.xml b/container/testdata/doctabs/mobile/dynamic_appended.xml index 11cd223128..f9ded16d12 100644 --- a/container/testdata/doctabs/mobile/dynamic_appended.xml +++ b/container/testdata/doctabs/mobile/dynamic_appended.xml @@ -4,15 +4,15 @@ - - Test1 - + + Test1 + - - Test2 - + + Test2 + @@ -27,7 +27,7 @@ - + Text 1 diff --git a/container/testdata/doctabs/mobile/dynamic_appended_and_removed.xml b/container/testdata/doctabs/mobile/dynamic_appended_and_removed.xml index 59a354a729..df39a97749 100644 --- a/container/testdata/doctabs/mobile/dynamic_appended_and_removed.xml +++ b/container/testdata/doctabs/mobile/dynamic_appended_and_removed.xml @@ -4,9 +4,9 @@ - - Test2 - + + Test2 + @@ -21,7 +21,7 @@ - + Text 2 diff --git a/container/testdata/doctabs/mobile/dynamic_appended_another_three.xml b/container/testdata/doctabs/mobile/dynamic_appended_another_three.xml index b4e262ec87..9d0be92c4e 100644 --- a/container/testdata/doctabs/mobile/dynamic_appended_another_three.xml +++ b/container/testdata/doctabs/mobile/dynamic_appended_another_three.xml @@ -3,28 +3,28 @@ - - - Test2 - + + + Test2 + - - Test3 - + + Test3 + - - Test4 - + + Test4 + - - Test5 - + + Test5 + @@ -33,8 +33,8 @@ - - + + @@ -47,7 +47,7 @@ - + Text 2 diff --git a/container/testdata/doctabs/mobile/dynamic_initial.xml b/container/testdata/doctabs/mobile/dynamic_initial.xml index 6b79f71956..a93a164b8e 100644 --- a/container/testdata/doctabs/mobile/dynamic_initial.xml +++ b/container/testdata/doctabs/mobile/dynamic_initial.xml @@ -4,9 +4,9 @@ - - Test1 - + + Test1 + @@ -21,7 +21,7 @@ - + Text 1 diff --git a/container/testdata/doctabs/mobile/dynamic_replaced_completely.xml b/container/testdata/doctabs/mobile/dynamic_replaced_completely.xml index b52b0bad50..4d87866b2a 100644 --- a/container/testdata/doctabs/mobile/dynamic_replaced_completely.xml +++ b/container/testdata/doctabs/mobile/dynamic_replaced_completely.xml @@ -4,21 +4,21 @@ - - Test6 - + + Test6 + - - Test7 - + + Test7 + - - Test8 - + + Test8 + @@ -33,7 +33,7 @@ - + Text 6 diff --git a/container/testdata/doctabs/mobile/hover_none.xml b/container/testdata/doctabs/mobile/hover_none.xml index 10523657c6..be39e6a4ab 100644 --- a/container/testdata/doctabs/mobile/hover_none.xml +++ b/container/testdata/doctabs/mobile/hover_none.xml @@ -3,16 +3,16 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + @@ -21,8 +21,8 @@ - - + + @@ -35,7 +35,7 @@ - + Text1 diff --git a/container/testdata/doctabs/mobile/layout_bottom_ico.xml b/container/testdata/doctabs/mobile/layout_bottom_ico.xml index ce7b86ee72..1df0bd559d 100644 --- a/container/testdata/doctabs/mobile/layout_bottom_ico.xml +++ b/container/testdata/doctabs/mobile/layout_bottom_ico.xml @@ -1,28 +1,28 @@ - - - - - + + + + + - + - - - - - + + + + + - - - + + + diff --git a/container/testdata/doctabs/mobile/layout_bottom_icon_and_text.xml b/container/testdata/doctabs/mobile/layout_bottom_icon_and_text.xml index be9e00add3..a7a8acf5e5 100644 --- a/container/testdata/doctabs/mobile/layout_bottom_icon_and_text.xml +++ b/container/testdata/doctabs/mobile/layout_bottom_icon_and_text.xml @@ -1,29 +1,29 @@ - - - - - Text1 - + + + + + Text1 + - + - - - - - + + + + + - - - + + + diff --git a/container/testdata/doctabs/mobile/layout_bottom_text.xml b/container/testdata/doctabs/mobile/layout_bottom_text.xml index 704d9466a8..6b149f6c06 100644 --- a/container/testdata/doctabs/mobile/layout_bottom_text.xml +++ b/container/testdata/doctabs/mobile/layout_bottom_text.xml @@ -4,9 +4,9 @@ - - Text2 - + + Text2 + @@ -21,7 +21,7 @@ - + diff --git a/container/testdata/doctabs/mobile/layout_top_icon.xml b/container/testdata/doctabs/mobile/layout_top_icon.xml index c2639051ef..087896f2b4 100644 --- a/container/testdata/doctabs/mobile/layout_top_icon.xml +++ b/container/testdata/doctabs/mobile/layout_top_icon.xml @@ -1,28 +1,28 @@ - - - - - + + + + + - + - - - - - + + + + + - - - + + + diff --git a/container/testdata/doctabs/mobile/layout_top_icon_and_text.xml b/container/testdata/doctabs/mobile/layout_top_icon_and_text.xml index 8b50f0680f..f326c67766 100644 --- a/container/testdata/doctabs/mobile/layout_top_icon_and_text.xml +++ b/container/testdata/doctabs/mobile/layout_top_icon_and_text.xml @@ -1,29 +1,29 @@ - - - - - Text1 - + + + + + Text1 + - + - - - - - + + + + + - - - + + + diff --git a/container/testdata/doctabs/mobile/layout_top_text.xml b/container/testdata/doctabs/mobile/layout_top_text.xml index e2a0b4f244..a5398f6ea0 100644 --- a/container/testdata/doctabs/mobile/layout_top_text.xml +++ b/container/testdata/doctabs/mobile/layout_top_text.xml @@ -4,9 +4,9 @@ - - Text2 - + + Text2 + @@ -21,7 +21,7 @@ - + diff --git a/container/testdata/doctabs/mobile/tab_location_bottom.xml b/container/testdata/doctabs/mobile/tab_location_bottom.xml index 8b4e701db1..0efc29f7c5 100644 --- a/container/testdata/doctabs/mobile/tab_location_bottom.xml +++ b/container/testdata/doctabs/mobile/tab_location_bottom.xml @@ -3,22 +3,22 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + diff --git a/container/testdata/doctabs/mobile/tab_location_top.xml b/container/testdata/doctabs/mobile/tab_location_top.xml index a78ea73487..2f20cf2025 100644 --- a/container/testdata/doctabs/mobile/tab_location_top.xml +++ b/container/testdata/doctabs/mobile/tab_location_top.xml @@ -3,22 +3,22 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + diff --git a/container/testdata/doctabs/mobile/tapped_all_tabs.xml b/container/testdata/doctabs/mobile/tapped_all_tabs.xml index 94d4bf8792..b07cb0685e 100644 --- a/container/testdata/doctabs/mobile/tapped_all_tabs.xml +++ b/container/testdata/doctabs/mobile/tapped_all_tabs.xml @@ -3,28 +3,28 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + - - Another - + + Another + @@ -33,8 +33,8 @@ - - + + @@ -52,7 +52,7 @@ - + Another Tab diff --git a/container/testdata/doctabs/mobile/tapped_create_tab.xml b/container/testdata/doctabs/mobile/tapped_create_tab.xml index 00e6cb6711..f18434b537 100644 --- a/container/testdata/doctabs/mobile/tapped_create_tab.xml +++ b/container/testdata/doctabs/mobile/tapped_create_tab.xml @@ -3,28 +3,28 @@ - - - Test1 - + + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + - - Another - + + Another + @@ -33,8 +33,8 @@ - - + + @@ -52,7 +52,7 @@ - + Another Tab diff --git a/container/testdata/doctabs/mobile/tapped_first_selected.xml b/container/testdata/doctabs/mobile/tapped_first_selected.xml index 8299dcc854..ce23b17ae3 100644 --- a/container/testdata/doctabs/mobile/tapped_first_selected.xml +++ b/container/testdata/doctabs/mobile/tapped_first_selected.xml @@ -4,21 +4,21 @@ - - Test1 - + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + @@ -38,7 +38,7 @@ - + Text 1 diff --git a/container/testdata/doctabs/mobile/tapped_second_selected.xml b/container/testdata/doctabs/mobile/tapped_second_selected.xml index dd421a8a68..6eb72bf8ef 100644 --- a/container/testdata/doctabs/mobile/tapped_second_selected.xml +++ b/container/testdata/doctabs/mobile/tapped_second_selected.xml @@ -4,21 +4,21 @@ - - Test1 - + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + @@ -38,7 +38,7 @@ - + Text 2 diff --git a/container/testdata/doctabs/mobile/tapped_third_selected.xml b/container/testdata/doctabs/mobile/tapped_third_selected.xml index eb3338ff1e..71ea3ea207 100644 --- a/container/testdata/doctabs/mobile/tapped_third_selected.xml +++ b/container/testdata/doctabs/mobile/tapped_third_selected.xml @@ -4,21 +4,21 @@ - - Test1 - + + Test1 + - - Test2 - + + Test2 + - - Test3 - + + Test3 + @@ -38,7 +38,7 @@ - + Text 3 diff --git a/container/testdata/doctabs/mobile/theme_default.png b/container/testdata/doctabs/mobile/theme_default.png index f742f4ea0a..939c4a293a 100644 Binary files a/container/testdata/doctabs/mobile/theme_default.png and b/container/testdata/doctabs/mobile/theme_default.png differ diff --git a/container/testdata/doctabs/mobile/theme_ugly.png b/container/testdata/doctabs/mobile/theme_ugly.png index 0704d5d9d5..1ab9a5491c 100644 Binary files a/container/testdata/doctabs/mobile/theme_ugly.png and b/container/testdata/doctabs/mobile/theme_ugly.png differ