mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 09:45:09 +00:00
Spreadsheet: Don't store help window's widgets in raw pointers
We can just use RefPtr for these and lighten the cognitive burden.
This commit is contained in:
parent
3c73b6d531
commit
60cf97726f
2 changed files with 6 additions and 7 deletions
|
@ -91,13 +91,12 @@ HelpWindow::HelpWindow(GUI::Window* parent)
|
||||||
left_frame.set_layout<GUI::VerticalBoxLayout>().set_margins({ 0, 0, 0, 0 });
|
left_frame.set_layout<GUI::VerticalBoxLayout>().set_margins({ 0, 0, 0, 0 });
|
||||||
left_frame.set_preferred_size(100, 0);
|
left_frame.set_preferred_size(100, 0);
|
||||||
left_frame.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
left_frame.set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill);
|
||||||
auto& list_view = left_frame.add<GUI::ListView>();
|
m_listview = left_frame.add<GUI::ListView>();
|
||||||
m_listview = &list_view;
|
m_listview->set_model(HelpListModel::create());
|
||||||
list_view.set_model(HelpListModel::create());
|
|
||||||
|
|
||||||
m_webview = &splitter.add<Web::OutOfProcessWebView>();
|
m_webview = splitter.add<Web::OutOfProcessWebView>();
|
||||||
|
|
||||||
list_view.on_activation = [this](auto& index) {
|
m_listview->on_activation = [this](auto& index) {
|
||||||
if (!m_webview)
|
if (!m_webview)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -55,8 +55,8 @@ private:
|
||||||
HelpWindow(GUI::Window* parent = nullptr);
|
HelpWindow(GUI::Window* parent = nullptr);
|
||||||
|
|
||||||
JsonObject m_docs;
|
JsonObject m_docs;
|
||||||
Web::OutOfProcessWebView* m_webview { nullptr };
|
RefPtr<Web::OutOfProcessWebView> m_webview;
|
||||||
GUI::ListView* m_listview { nullptr };
|
RefPtr<GUI::ListView> m_listview;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue