fix(ui): do not intercept Alt+Left and Alt+Right

These are reserved for back and forward browser actions.

Fixes #1531.
This commit is contained in:
Oleg Shparber 2023-09-07 00:58:17 -04:00
parent 780f2388b1
commit 2024915307
3 changed files with 5 additions and 33 deletions

View File

@ -122,14 +122,10 @@ MainWindow::MainWindow(Core::Application *app, QWidget *parent)
}
});
ui->actionBack->setShortcut(QKeySequence::Back);
connect(ui->actionBack, &QAction::triggered, this, [this]() { currentTab()->webControl()->back(); });
addAction(ui->actionBack);
ui->actionForward->setShortcut(QKeySequence::Forward);
connect(ui->actionForward, &QAction::triggered, this, [this]() { currentTab()->webControl()->forward(); });
addAction(ui->actionForward);
shortcut = new QShortcut(QKeySequence::Back, this);
connect(shortcut, &QShortcut::activated, this, [this]() { currentTab()->webControl()->back(); });
shortcut = new QShortcut(QKeySequence::Forward, this);
connect(shortcut, &QShortcut::activated, this, [this]() { currentTab()->webControl()->forward(); });
shortcut = new QShortcut(QKeySequence::ZoomIn, this);
connect(shortcut, &QShortcut::activated, this, [this]() { currentTab()->webControl()->zoomIn(); });
shortcut = new QShortcut(QStringLiteral("Ctrl+="), this);

View File

@ -132,30 +132,6 @@
<string>About &amp;Zeal</string>
</property>
</action>
<action name="actionBack">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset theme="go-previous">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;Back</string>
</property>
</action>
<action name="actionForward">
<property name="enabled">
<bool>false</bool>
</property>
<property name="icon">
<iconset theme="go-next">
<normaloff>.</normaloff>.</iconset>
</property>
<property name="text">
<string>&amp;Forward</string>
</property>
</action>
<action name="actionNewTab">
<property name="icon">
<iconset theme="tab-new">

View File

@ -85,7 +85,7 @@ SearchSidebar::SearchSidebar(const SearchSidebar *other, QWidget *parent)
connect(m_treeView, &QTreeView::clicked, this, &SearchSidebar::navigateToIndex);
// Setup Alt+Up, Alt+Down, etc shortcuts.
const auto keyList = {Qt::Key_Up, Qt::Key_Down, Qt::Key_Left, Qt::Key_Right,
const auto keyList = {Qt::Key_Up, Qt::Key_Down,
Qt::Key_PageUp, Qt::Key_PageDown,
Qt::Key_Home, Qt::Key_End};
for (const auto key : keyList) {