1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-24 12:46:35 +01:00

BrowserWindow: Make Ctrl+PgUp/Down shortcuts use tab bar order

This commit is contained in:
David Rosca 2018-02-06 15:00:49 +01:00
parent beeb68f7a6
commit 6c94d40187
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8
2 changed files with 4 additions and 8 deletions

View File

@ -1344,15 +1344,13 @@ void BrowserWindow::keyPressEvent(QKeyEvent* event)
case Qt::Key_Tab:
if (event->modifiers() == Qt::ControlModifier) {
m_tabWidget->nextTab();
event->accept();
QApplication::sendEvent(m_tabWidget, event);
}
break;
case Qt::Key_Backtab:
if (event->modifiers() == (Qt::ControlModifier + Qt::ShiftModifier)) {
m_tabWidget->previousTab();
event->accept();
QApplication::sendEvent(m_tabWidget, event);
}
break;

View File

@ -538,14 +538,12 @@ void TabWidget::setCurrentIndex(int index)
void TabWidget::nextTab()
{
QKeyEvent fakeEvent(QKeyEvent::KeyPress, Qt::Key_Tab, Qt::ControlModifier);
keyPressEvent(&fakeEvent);
setCurrentIndex((currentIndex() + 1) % count());
}
void TabWidget::previousTab()
{
QKeyEvent fakeEvent(QKeyEvent::KeyPress, Qt::Key_Backtab, QFlags<Qt::KeyboardModifier>(Qt::ControlModifier + Qt::ShiftModifier));
keyPressEvent(&fakeEvent);
setCurrentIndex(currentIndex() == 0 ? count() - 1 : currentIndex() - 1);
}
int TabWidget::normalTabsCount() const