mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 10: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:
|
case Qt::Key_Tab:
|
||||||
if (event->modifiers() == Qt::ControlModifier) {
|
if (event->modifiers() == Qt::ControlModifier) {
|
||||||
m_tabWidget->nextTab();
|
QApplication::sendEvent(m_tabWidget, event);
|
||||||
event->accept();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case Qt::Key_Backtab:
|
case Qt::Key_Backtab:
|
||||||
if (event->modifiers() == (Qt::ControlModifier + Qt::ShiftModifier)) {
|
if (event->modifiers() == (Qt::ControlModifier + Qt::ShiftModifier)) {
|
||||||
m_tabWidget->previousTab();
|
QApplication::sendEvent(m_tabWidget, event);
|
||||||
event->accept();
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -538,14 +538,12 @@ void TabWidget::setCurrentIndex(int index)
|
|||||||
|
|
||||||
void TabWidget::nextTab()
|
void TabWidget::nextTab()
|
||||||
{
|
{
|
||||||
QKeyEvent fakeEvent(QKeyEvent::KeyPress, Qt::Key_Tab, Qt::ControlModifier);
|
setCurrentIndex((currentIndex() + 1) % count());
|
||||||
keyPressEvent(&fakeEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabWidget::previousTab()
|
void TabWidget::previousTab()
|
||||||
{
|
{
|
||||||
QKeyEvent fakeEvent(QKeyEvent::KeyPress, Qt::Key_Backtab, QFlags<Qt::KeyboardModifier>(Qt::ControlModifier + Qt::ShiftModifier));
|
setCurrentIndex(currentIndex() == 0 ? count() - 1 : currentIndex() - 1);
|
||||||
keyPressEvent(&fakeEvent);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
int TabWidget::normalTabsCount() const
|
int TabWidget::normalTabsCount() const
|
||||||
|
Loading…
Reference in New Issue
Block a user