From 291960d15957d7284a29d779bbc7f7f62ec7e1be Mon Sep 17 00:00:00 2001 From: Kamil Chojnowski Date: Wed, 15 Jan 2014 02:32:02 +0100 Subject: [PATCH 1/2] Make tab navigation more intuitive --- modules/corelib/ui/uimovabletabbar.lua | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/corelib/ui/uimovabletabbar.lua b/modules/corelib/ui/uimovabletabbar.lua index 33298ec8..82a89873 100644 --- a/modules/corelib/ui/uimovabletabbar.lua +++ b/modules/corelib/ui/uimovabletabbar.lua @@ -390,6 +390,8 @@ function UIMoveableTabBar:selectNextTab() local widget = showPostTab(self) self:selectTab(widget) updateTabs(self) + else + self:selectTab(self.tabs[1]) end return end @@ -418,6 +420,8 @@ function UIMoveableTabBar:selectPrevTab() local widget = showPreTab(self) self:selectTab(widget) updateTabs(self) + else + self:selectTab(self.tabs[#self.tabs]) end return end @@ -461,4 +465,4 @@ function UIMoveableTabBar:setNavigation(prevButton, nextButton) nextNavigation.onClick = function() self:selectNextTab() end end updateNavigation(self) -end \ No newline at end of file +end From b718ae0423a61f5e29a2ef7a8b9af105212c3d43 Mon Sep 17 00:00:00 2001 From: Kamil Chojnowski Date: Wed, 15 Jan 2014 04:56:42 +0100 Subject: [PATCH 2/2] Update tabs navigation to take offscreen tabs into account --- modules/corelib/ui/uimovabletabbar.lua | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/corelib/ui/uimovabletabbar.lua b/modules/corelib/ui/uimovabletabbar.lua index 82a89873..b60a1c77 100644 --- a/modules/corelib/ui/uimovabletabbar.lua +++ b/modules/corelib/ui/uimovabletabbar.lua @@ -389,10 +389,16 @@ function UIMoveableTabBar:selectNextTab() if #self.postTabs > 0 then local widget = showPostTab(self) self:selectTab(widget) - updateTabs(self) else + if #self.preTabs > 0 then + for i = 1, #self.preTabs do + showPreTab(self) + end + end + self:selectTab(self.tabs[1]) end + updateTabs(self) return end @@ -419,10 +425,16 @@ function UIMoveableTabBar:selectPrevTab() if #self.preTabs > 0 then local widget = showPreTab(self) self:selectTab(widget) - updateTabs(self) else + if #self.postTabs > 0 then + for i = 1, #self.postTabs do + showPostTab(self) + end + end + self:selectTab(self.tabs[#self.tabs]) end + updateTabs(self) return end