mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-06 08:10:02 +00:00
Inspector+UI: Close inspector with shortcuts
This brings keyboard shortcuts for the inspector up with common convention in FF and Chrome: Ctrl+Shift+C now also opens the inspector, and F12, Ctrl+W, and Ctrl+Shift+I now close the inspector when the inspector window is focused. Resolves #972
This commit is contained in:
parent
a24718cc49
commit
5cfed4524d
Notes:
github-actions[bot]
2025-01-03 10:48:11 +00:00
Author: https://github.com/tyzoid
Commit: 5cfed4524d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2746
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 31 additions and 3 deletions
|
@ -355,7 +355,9 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, IsPopupWindow
|
|||
|
||||
auto* inspector_action = new QAction("Open &Inspector", this);
|
||||
inspector_action->setIcon(load_icon_from_uri("resource://icons/browser/dom-tree.png"sv));
|
||||
inspector_action->setShortcuts({ QKeySequence("Ctrl+Shift+I"), QKeySequence("F12") });
|
||||
inspector_action->setShortcuts({ QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_I),
|
||||
QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C),
|
||||
QKeySequence(Qt::Key_F12) });
|
||||
inspect_menu->addAction(inspector_action);
|
||||
QObject::connect(inspector_action, &QAction::triggered, this, [this] {
|
||||
if (m_current_tab) {
|
||||
|
@ -472,7 +474,6 @@ BrowserWindow::BrowserWindow(Vector<URL::URL> const& initial_urls, IsPopupWindow
|
|||
});
|
||||
|
||||
auto* clear_cache_action = new QAction("Clear &Cache", this);
|
||||
clear_cache_action->setShortcut(QKeySequence(Qt::CTRL | Qt::SHIFT | Qt::Key_C));
|
||||
clear_cache_action->setIcon(load_icon_from_uri("resource://icons/browser/clear-cache.png"sv));
|
||||
debug_menu->addAction(clear_cache_action);
|
||||
QObject::connect(clear_cache_action, &QAction::triggered, this, [this] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue