From ea3e9a310287e4a8f9946763086578745935d818 Mon Sep 17 00:00:00 2001 From: Julen Ruiz Aizpuru Date: Sat, 17 Sep 2022 18:06:08 +0200 Subject: [PATCH] Ladybird/Tab: Make back/forward keyboard shortcuts platform-specific MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This commit changes how we set the back and forward button key bindings to use platform-specific standard key sequences. For example, in Mac OS X, the back action will be now triggered via Cmd+← and Cmd+[, whereas previously the action was mapped to Alt+←, which is not standard in Mac OS X. --- Ladybird/Tab.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Ladybird/Tab.cpp b/Ladybird/Tab.cpp index b70d8cf77d..7fb1fa74c8 100644 --- a/Ladybird/Tab.cpp +++ b/Ladybird/Tab.cpp @@ -46,9 +46,9 @@ Tab::Tab(QMainWindow* window) auto home_icon_path = QString("%1/res/icons/16x16/go-home.png").arg(s_serenity_resource_root.characters()); auto reload_icon_path = QString("%1/res/icons/16x16/reload.png").arg(s_serenity_resource_root.characters()); m_back_action = make(QIcon(back_icon_path), "Back"); - m_back_action->setShortcut(QKeySequence("Alt+Left")); + m_back_action->setShortcuts(QKeySequence::keyBindings(QKeySequence::StandardKey::Back)); m_forward_action = make(QIcon(forward_icon_path), "Forward"); - m_forward_action->setShortcut(QKeySequence("Alt+Right")); + m_forward_action->setShortcuts(QKeySequence::keyBindings(QKeySequence::StandardKey::Forward)); m_home_action = make(QIcon(home_icon_path), "Home"); m_reload_action = make(QIcon(reload_icon_path), "Reload"); m_reload_action->setShortcut(QKeySequence("Ctrl+R"));