1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

Ladybird: Add Ctrl+= as an alternate "zoom in" shortcut

On many keyboards, Ctrl++ is actually Ctrl+Shift+=, and Ctrl+= makes
more sense as it's symmetric with Ctrl+-.

Both Firefox and Chrome already support this alternate shortcut,
so let's be nice and support it in Ladybird as well. :^)
This commit is contained in:
Andreas Kling 2023-01-12 19:52:24 +01:00 committed by Linus Groh
parent c8ea23a4fe
commit 2eaebdea5b

View file

@ -84,7 +84,9 @@ BrowserWindow::BrowserWindow(Browser::CookieJar& cookie_jar, StringView webdrive
auto* zoom_menu = view_menu->addMenu("&Zoom");
auto* zoom_in_action = new QAction("Zoom &In", this);
zoom_in_action->setShortcuts(QKeySequence::keyBindings(QKeySequence::StandardKey::ZoomIn));
auto zoom_in_shortcuts = QKeySequence::keyBindings(QKeySequence::StandardKey::ZoomIn);
zoom_in_shortcuts.append(QKeySequence(Qt::CTRL | Qt::Key_Equal));
zoom_in_action->setShortcuts(zoom_in_shortcuts);
zoom_menu->addAction(zoom_in_action);
QObject::connect(zoom_in_action, &QAction::triggered, this, &BrowserWindow::zoom_in);