Skip to content

Commit

Permalink
[SUTK] Scroll to the selected tab (when the user clicks on a tab)
Browse files Browse the repository at this point in the history
  • Loading branch information
ravi688 committed Jan 8, 2025
1 parent 6b3965b commit 98ea793
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion sutk/include/sutk/NotebookView.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ namespace SUTK
// Create Page
T* page = getUIDriver().createObject<T>(container, std::forward<Args&&>(args)...);
// Create Tab for the page
Tab* tab = createTab(labelStr, page, afterPage ? afterPage->getTab() : com::null_pointer<Tab>());
createTab(labelStr, page, afterPage ? afterPage->getTab() : com::null_pointer<Tab>());
// Newly created page should be activated
viewPage(page);
dump();
Expand Down
1 change: 1 addition & 0 deletions sutk/source/NotebookView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ namespace SUTK
m_tabBar->getOnSelectEvent().subscribe([this](Tab* tab) noexcept
{
this->m_onPageSelectEvent.publish(tab->getPage());
this->m_tabBar->scrollToTab(tab);
});
m_tabBar->getOnRemoveEvent().subscribe([this](Tab* tab) noexcept
{
Expand Down

0 comments on commit 98ea793

Please sign in to comment.