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:
parent
beeb68f7a6
commit
6c94d40187
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user