mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-11 01:22:10 +01:00
Merge branch 'Falkon/3.1'
This commit is contained in:
commit
ee4dbad676
|
@ -166,6 +166,10 @@ void SideBarManager::showSideBar(const QString &id, bool toggle)
|
|||
|
||||
if (!m_sideBar) {
|
||||
m_sideBar = m_window->addSideBar();
|
||||
connect(m_sideBar, &QObject::destroyed, this, [this]() {
|
||||
m_activeBar.clear();
|
||||
m_window->saveSideBarSettings();
|
||||
});
|
||||
}
|
||||
|
||||
if (id == m_activeBar) {
|
||||
|
|
|
@ -56,18 +56,53 @@ QWidget *VerticalTabsController::createSideBarWidget(BrowserWindow *window)
|
|||
|
||||
bool VerticalTabsController::handleKeyPress(QKeyEvent *event, TabWidget *tabWidget)
|
||||
{
|
||||
if (event->key() == Qt::Key_Tab && event->modifiers() == Qt::ControlModifier) {
|
||||
auto switchToNextTab = [=]() {
|
||||
VerticalTabsWidget *widget = m_widgets.value(tabWidget->browserWindow());
|
||||
if (widget) {
|
||||
widget->switchToNextTab();
|
||||
return true;
|
||||
}
|
||||
} else if (event->key() == Qt::Key_Backtab && event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
|
||||
return false;
|
||||
};
|
||||
|
||||
auto switchToPreviousTab = [=]() {
|
||||
VerticalTabsWidget *widget = m_widgets.value(tabWidget->browserWindow());
|
||||
if (widget) {
|
||||
widget->switchToPreviousTab();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
};
|
||||
|
||||
switch (event->key()) {
|
||||
case Qt::Key_Tab:
|
||||
case Qt::Key_PageDown:
|
||||
if (event->modifiers() == Qt::ControlModifier) {
|
||||
if (switchToNextTab()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_Backtab:
|
||||
if (event->modifiers() == (Qt::ShiftModifier | Qt::ControlModifier)) {
|
||||
if (switchToPreviousTab()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case Qt::Key_PageUp:
|
||||
if (event->modifiers() == Qt::ControlModifier) {
|
||||
if (switchToPreviousTab()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user