mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:38:12 +00:00
Ladybird/Qt: Make the Inspector widget owned by its parent tab
This ensures the Inspector is closed when the BrowserWindow which owns the tab is closed.
This commit is contained in:
parent
4653733a0d
commit
c55d8a9971
3 changed files with 4 additions and 3 deletions
|
@ -13,7 +13,8 @@ namespace Ladybird {
|
||||||
|
|
||||||
extern bool is_using_dark_system_theme(QWidget&);
|
extern bool is_using_dark_system_theme(QWidget&);
|
||||||
|
|
||||||
InspectorWidget::InspectorWidget(WebContentView& content_view)
|
InspectorWidget::InspectorWidget(QWidget* tab, WebContentView& content_view)
|
||||||
|
: QWidget(tab, Qt::Window)
|
||||||
{
|
{
|
||||||
m_inspector_view = new WebContentView({}, {});
|
m_inspector_view = new WebContentView({}, {});
|
||||||
|
|
||||||
|
|
|
@ -18,7 +18,7 @@ class InspectorWidget final : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit InspectorWidget(WebContentView& content_view);
|
InspectorWidget(QWidget* tab, WebContentView& content_view);
|
||||||
virtual ~InspectorWidget() override;
|
virtual ~InspectorWidget() override;
|
||||||
|
|
||||||
void inspect();
|
void inspect();
|
||||||
|
|
|
@ -690,7 +690,7 @@ void Tab::recreate_toolbar_icons()
|
||||||
void Tab::show_inspector_window(InspectorTarget inspector_target)
|
void Tab::show_inspector_window(InspectorTarget inspector_target)
|
||||||
{
|
{
|
||||||
if (!m_inspector_widget)
|
if (!m_inspector_widget)
|
||||||
m_inspector_widget = new Ladybird::InspectorWidget(view());
|
m_inspector_widget = new InspectorWidget(this, view());
|
||||||
|
|
||||||
m_inspector_widget->show();
|
m_inspector_widget->show();
|
||||||
m_inspector_widget->activateWindow();
|
m_inspector_widget->activateWindow();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue