diff --git a/win-linux/src/components/asctabwidget.cpp b/win-linux/src/components/asctabwidget.cpp index 1f813aded..cf9f7efb2 100644 --- a/win-linux/src/components/asctabwidget.cpp +++ b/win-linux/src/components/asctabwidget.cpp @@ -142,6 +142,11 @@ CAscTabWidget::CAscTabWidget(QWidget *parent, CTabBar *_pBar) static int _dropedindex = -1; QObject::connect(this, &CAscTabWidget::currentChanged, this, [=](int index) { QTimer::singleShot(0, this, [=]() { + if (index != -1 && index != m_pBar->currentIndex()) { + m_pBar->blockSignals(true); + m_pBar->setCurrentIndex(index); + m_pBar->blockSignals(false); + } updateIcons(); }); setFocusedView(); @@ -171,7 +176,9 @@ CAscTabWidget::CAscTabWidget(QWidget *parent, CTabBar *_pBar) } }); auto turnOffAltHints = [=](int old_index, int index) { - this->setCurrentIndex(index); + QTimer::singleShot(0, this, [=]() { + setCurrentIndex(index); + }); if (old_index > -1) AscAppManager::sendCommandTo(panel(old_index)->cef(), L"althints:show", L"false"); }; diff --git a/win-linux/src/windows/cmainwindow.cpp b/win-linux/src/windows/cmainwindow.cpp index ecdc55624..d1b148a3f 100644 --- a/win-linux/src/windows/cmainwindow.cpp +++ b/win-linux/src/windows/cmainwindow.cpp @@ -521,11 +521,11 @@ void CMainWindow::onEditorAllowedClose(int uid) } else { int _index = m_pTabs->tabIndexByView(uid); if ( !(_index < 0) ) { + m_pTabs->tabBar()->removeTab(_index); QWidget * _view = m_pTabs->widget(_index); m_pTabs->removeWidget(_view); _view->deleteLater(); - m_pTabs->tabBar()->removeTab(_index); //m_pTabs->adjustTabsSize(); onTabChanged(m_pTabs->currentIndex());