2022-12-18 00:50:53 +00:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-01-12 20:22:14 +00:00
|
|
|
#include "WebContentView.h"
|
2023-12-05 21:58:26 +00:00
|
|
|
#include <LibGfx/Point.h>
|
2023-11-24 01:04:54 +00:00
|
|
|
#include <LibWebView/Forward.h>
|
2022-12-18 00:50:53 +00:00
|
|
|
#include <QWidget>
|
|
|
|
|
2023-12-05 21:58:26 +00:00
|
|
|
class QAction;
|
|
|
|
class QMenu;
|
|
|
|
|
2022-12-18 00:50:53 +00:00
|
|
|
namespace Ladybird {
|
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
class WebContentView;
|
|
|
|
|
2022-12-18 00:50:53 +00:00
|
|
|
class InspectorWidget final : public QWidget {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
public:
|
2023-12-04 16:03:40 +00:00
|
|
|
InspectorWidget(QWidget* tab, WebContentView& content_view);
|
2023-11-24 01:04:54 +00:00
|
|
|
virtual ~InspectorWidget() override;
|
2023-05-08 20:15:35 +00:00
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
void inspect();
|
|
|
|
void reset();
|
2023-05-08 20:15:35 +00:00
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
void select_hovered_node();
|
2023-05-08 20:15:35 +00:00
|
|
|
void select_default_node();
|
|
|
|
|
2023-12-13 18:10:05 +00:00
|
|
|
public slots:
|
|
|
|
void device_pixel_ratio_changed(qreal dpi);
|
|
|
|
|
2023-11-24 01:04:54 +00:00
|
|
|
private:
|
2024-07-14 16:29:33 +00:00
|
|
|
virtual bool event(QEvent*) override;
|
2022-12-18 00:50:53 +00:00
|
|
|
void closeEvent(QCloseEvent*) override;
|
|
|
|
|
2023-12-13 18:10:05 +00:00
|
|
|
QScreen* m_current_screen;
|
|
|
|
double m_device_pixel_ratio { 0 };
|
|
|
|
|
2023-12-04 14:39:22 +00:00
|
|
|
WebContentView* m_inspector_view;
|
2023-11-24 01:04:54 +00:00
|
|
|
OwnPtr<WebView::InspectorClient> m_inspector_client;
|
2023-12-05 21:58:26 +00:00
|
|
|
|
|
|
|
QMenu* m_dom_node_text_context_menu { nullptr };
|
|
|
|
QMenu* m_dom_node_tag_context_menu { nullptr };
|
|
|
|
QMenu* m_dom_node_attribute_context_menu { nullptr };
|
2024-09-06 17:22:58 +00:00
|
|
|
QMenu* m_cookie_context_menu { nullptr };
|
2023-12-05 21:58:26 +00:00
|
|
|
|
|
|
|
QAction* m_edit_node_action { nullptr };
|
2023-12-06 16:16:28 +00:00
|
|
|
QAction* m_copy_node_action { nullptr };
|
2023-12-06 16:56:16 +00:00
|
|
|
QAction* m_screenshot_node_action { nullptr };
|
2023-12-07 16:05:34 +00:00
|
|
|
QAction* m_create_child_element_action { nullptr };
|
|
|
|
QAction* m_create_child_text_node_action { nullptr };
|
2023-12-07 16:13:15 +00:00
|
|
|
QAction* m_clone_node_action { nullptr };
|
2023-12-05 21:58:26 +00:00
|
|
|
QAction* m_delete_node_action { nullptr };
|
|
|
|
QAction* m_add_attribute_action { nullptr };
|
|
|
|
QAction* m_remove_attribute_action { nullptr };
|
2023-12-06 15:12:31 +00:00
|
|
|
QAction* m_copy_attribute_value_action { nullptr };
|
2024-09-06 17:22:58 +00:00
|
|
|
QAction* m_delete_cookie_action { nullptr };
|
|
|
|
QAction* m_delete_all_cookies_action { nullptr };
|
2022-12-18 00:50:53 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|