summaryrefslogtreecommitdiff
path: root/src/components/channeltabswitcherhandy.cpp
diff options
context:
space:
mode:
authorouwou <26526779+ouwou@users.noreply.github.com>2022-05-09 01:33:09 -0400
committerouwou <26526779+ouwou@users.noreply.github.com>2022-05-09 01:33:09 -0400
commitbbf32730cd322ab8d826b9fb73d83fbde73c5419 (patch)
treeb1a1d49baf0e78369dd0c270abc975393bfec89f /src/components/channeltabswitcherhandy.cpp
parentf58ca39e8c49f30783b3bbe5f02d73aa52433215 (diff)
downloadabaddon-portaudio-bbf32730cd322ab8d826b9fb73d83fbde73c5419.tar.gz
abaddon-portaudio-bbf32730cd322ab8d826b9fb73d83fbde73c5419.zip
add ctrl(+shift)+tab keybinds
Diffstat (limited to 'src/components/channeltabswitcherhandy.cpp')
-rw-r--r--src/components/channeltabswitcherhandy.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/components/channeltabswitcherhandy.cpp b/src/components/channeltabswitcherhandy.cpp
index 67dbff0..2faa2e2 100644
--- a/src/components/channeltabswitcherhandy.cpp
+++ b/src/components/channeltabswitcherhandy.cpp
@@ -115,6 +115,22 @@ void ChannelTabSwitcherHandy::GoForwardOnCurrent() {
AdvanceOnCurrent(1);
}
+void ChannelTabSwitcherHandy::GoToPreviousTab() {
+ if (!hdy_tab_view_select_previous_page(m_tab_view)) {
+ if (const auto num_pages = hdy_tab_view_get_n_pages(m_tab_view); num_pages > 1) {
+ hdy_tab_view_set_selected_page(m_tab_view, hdy_tab_view_get_nth_page(m_tab_view, num_pages - 1));
+ }
+ }
+}
+
+void ChannelTabSwitcherHandy::GoToNextTab() {
+ if (!hdy_tab_view_select_next_page(m_tab_view)) {
+ if (hdy_tab_view_get_n_pages(m_tab_view) > 1) {
+ hdy_tab_view_set_selected_page(m_tab_view, hdy_tab_view_get_nth_page(m_tab_view, 0));
+ }
+ }
+}
+
int ChannelTabSwitcherHandy::GetNumberOfTabs() const {
return hdy_tab_view_get_n_pages(m_tab_view);
}