Use the new tab position setting for *all* new tabs (SpartanJ/ecode#904).

This commit is contained in:
Martín Lucas Golini
2026-06-04 16:42:10 -03:00
parent bd2c8991a7
commit 9bfa128658
3 changed files with 34 additions and 38 deletions
+27
View File
@@ -1818,6 +1818,33 @@ void App::onTabCreated( UITab* tab, UIWidget* ) {
}
} );
} );
applyNewTabPosition( tab );
}
void App::applyNewTabPosition( UITab* tab ) {
UITabWidget* tabWidget = tab->getTabWidget();
if ( !tabWidget )
return;
switch ( mConfig.editor.newTabPosition ) {
case NewTabPosition::AfterActive: {
Uint32 selectedIdx = tabWidget->getTabSelectedIndex();
Uint32 newIdx = eemin<Uint32>( selectedIdx + 1, tabWidget->getTabCount() - 1 );
tabWidget->moveTab( tab, newIdx );
break;
}
case NewTabPosition::First:
tabWidget->moveTab( tab, 0 );
break;
case NewTabPosition::LeftOfActive: {
Uint32 selectedIdx = tabWidget->getTabSelectedIndex();
tabWidget->moveTab( tab, eemin<Uint32>( selectedIdx, tabWidget->getTabCount() - 1 ) );
break;
}
case NewTabPosition::Last:
default:
break;
}
}
void App::onColorSchemeChanged( const std::string& ) {