Skip to content

Commit 98ea793

Browse files
committed
[SUTK] Scroll to the selected tab (when the user clicks on a tab)
1 parent 6b3965b commit 98ea793

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

sutk/include/sutk/NotebookView.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ namespace SUTK
309309
// Create Page
310310
T* page = getUIDriver().createObject<T>(container, std::forward<Args&&>(args)...);
311311
// Create Tab for the page
312-
Tab* tab = createTab(labelStr, page, afterPage ? afterPage->getTab() : com::null_pointer<Tab>());
312+
createTab(labelStr, page, afterPage ? afterPage->getTab() : com::null_pointer<Tab>());
313313
// Newly created page should be activated
314314
viewPage(page);
315315
dump();

sutk/source/NotebookView.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ namespace SUTK
110110
m_tabBar->getOnSelectEvent().subscribe([this](Tab* tab) noexcept
111111
{
112112
this->m_onPageSelectEvent.publish(tab->getPage());
113+
this->m_tabBar->scrollToTab(tab);
113114
});
114115
m_tabBar->getOnRemoveEvent().subscribe([this](Tab* tab) noexcept
115116
{

0 commit comments

Comments
 (0)