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
|
@ -899,10 +899,23 @@ void Tab::recreate_toolbar_icons()
|
|||
m_hamburger_button->setIcon(create_tvg_icon_with_theme_colors("hamburger", palette()));
|
||||
}
|
||||
|
||||
void Tab::recreate_inspector()
|
||||
{
|
||||
if (m_inspector_widget)
|
||||
m_inspector_widget->deleteLater();
|
||||
|
||||
m_inspector_widget = new InspectorWidget(this, view());
|
||||
|
||||
QObject::connect(m_inspector_widget, &InspectorWidget::closed, [this] {
|
||||
m_inspector_widget->deleteLater();
|
||||
m_inspector_widget = nullptr;
|
||||
});
|
||||
}
|
||||
|
||||
void Tab::show_inspector_window(InspectorTarget inspector_target)
|
||||
{
|
||||
if (!m_inspector_widget)
|
||||
m_inspector_widget = new InspectorWidget(this, view());
|
||||
recreate_inspector();
|
||||
else
|
||||
m_inspector_widget->inspect();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue