mirror of
https://github.com/ONLYOFFICE/desktop-apps.git
synced 2026-04-07 14:09:22 +08:00
Merge pull request #937 from ONLYOFFICE/fix/tab_switching
Fix switching tabs with Ctrl+Tab shortcut
This commit is contained in:
@ -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");
|
||||
};
|
||||
|
||||
@ -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());
|
||||
|
||||
Reference in New Issue
Block a user