From 1d8ef79da68a89c4561b9079b795d05484ddc419 Mon Sep 17 00:00:00 2001 From: ouwou <26526779+ouwou@users.noreply.github.com> Date: Tue, 10 May 2022 01:09:42 -0400 Subject: add ctrl+number key shortcuts for tabs --- src/components/channeltabswitcherhandy.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/components/channeltabswitcherhandy.cpp') diff --git a/src/components/channeltabswitcherhandy.cpp b/src/components/channeltabswitcherhandy.cpp index 2faa2e2..7488d6f 100644 --- a/src/components/channeltabswitcherhandy.cpp +++ b/src/components/channeltabswitcherhandy.cpp @@ -131,6 +131,11 @@ void ChannelTabSwitcherHandy::GoToNextTab() { } } +void ChannelTabSwitcherHandy::GoToTab(int idx) { + if (hdy_tab_view_get_n_pages(m_tab_view) >= idx + 1) + hdy_tab_view_set_selected_page(m_tab_view, hdy_tab_view_get_nth_page(m_tab_view, idx)); +} + int ChannelTabSwitcherHandy::GetNumberOfTabs() const { return hdy_tab_view_get_n_pages(m_tab_view); } -- cgit v1.2.3