mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ladybird: Make Tab.cpp directly take a BrowserWindows as m_window
This commit is contained in:
parent
445cc7c97d
commit
bdce860ac5
Notes:
sideshowbarker
2024-07-17 20:19:08 +09:00
Author: https://github.com/AaronDewes 🔰 Commit: https://github.com/SerenityOS/serenity/commit/bdce860ac5 Pull-request: https://github.com/SerenityOS/serenity/pull/16583 Reviewed-by: https://github.com/ADKaster Reviewed-by: https://github.com/awesomekling ✅ Reviewed-by: https://github.com/linusg
2 changed files with 6 additions and 7 deletions
|
@ -18,7 +18,7 @@
|
|||
extern String s_serenity_resource_root;
|
||||
extern Browser::Settings* s_settings;
|
||||
|
||||
Tab::Tab(QMainWindow* window)
|
||||
Tab::Tab(BrowserWindow* window)
|
||||
: m_window(window)
|
||||
{
|
||||
m_layout = new QBoxLayout(QBoxLayout::Direction::TopToBottom, this);
|
||||
|
@ -146,10 +146,7 @@ void Tab::page_favicon_changed(QIcon icon)
|
|||
|
||||
int Tab::tab_index()
|
||||
{
|
||||
// FIXME: I hear you like footguns...
|
||||
// There has to be a better way of doing this
|
||||
auto browser_window = reinterpret_cast<BrowserWindow*>(m_window);
|
||||
return browser_window->tab_index(this);
|
||||
return m_window->tab_index(this);
|
||||
}
|
||||
|
||||
void Tab::debug_request(String const& request, String const& argument)
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
#include <QToolBar>
|
||||
#include <QWidget>
|
||||
|
||||
class BrowserWindow;
|
||||
|
||||
class Tab final : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit Tab(QMainWindow* window);
|
||||
explicit Tab(BrowserWindow* window);
|
||||
|
||||
WebView& view() { return *m_view; }
|
||||
|
||||
|
@ -51,7 +53,7 @@ private:
|
|||
QToolBar* m_toolbar { nullptr };
|
||||
QLineEdit* m_location_edit { nullptr };
|
||||
WebView* m_view { nullptr };
|
||||
QMainWindow* m_window { nullptr };
|
||||
BrowserWindow* m_window { nullptr };
|
||||
Browser::History m_history;
|
||||
QString m_title;
|
||||
QLabel* m_hover_label { nullptr };
|
||||
|
|
Loading…
Reference in a new issue