Fix timing of onTabChanged callbacks
This commit is contained in:
parent
704b5894d1
commit
6be4f2c946
1 changed files with 2 additions and 4 deletions
|
@ -1664,11 +1664,10 @@ void MainWindow::on_action_Save_triggered() {
|
|||
void MainWindow::on_mapViewTab_tabBarClicked(int index)
|
||||
{
|
||||
int oldIndex = ui->mapViewTab->currentIndex();
|
||||
ui->mapViewTab->setCurrentIndex(index);
|
||||
if (index != oldIndex)
|
||||
Scripting::cb_MapViewTabChanged(oldIndex, index);
|
||||
|
||||
ui->mapViewTab->setCurrentIndex(index);
|
||||
|
||||
if (index == 0) {
|
||||
editor->setEditingMap();
|
||||
} else if (index == 1) {
|
||||
|
@ -1685,11 +1684,10 @@ void MainWindow::on_action_Exit_triggered()
|
|||
void MainWindow::on_mainTabBar_tabBarClicked(int index)
|
||||
{
|
||||
int oldIndex = ui->mainTabBar->currentIndex();
|
||||
ui->mainTabBar->setCurrentIndex(index);
|
||||
if (index != oldIndex)
|
||||
Scripting::cb_MainTabChanged(oldIndex, index);
|
||||
|
||||
ui->mainTabBar->setCurrentIndex(index);
|
||||
|
||||
int tabIndexToStackIndex[5] = {0, 0, 1, 2, 3};
|
||||
ui->mainStackedWidget->setCurrentIndex(tabIndexToStackIndex[index]);
|
||||
|
||||
|
|
Loading…
Reference in a new issue