1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

Userspace: Use Core::Object::add() when building interfaces

This commit is contained in:
Andreas Kling 2020-02-23 10:57:42 +01:00
parent 7ec758773c
commit 3d20da9ee4
87 changed files with 403 additions and 438 deletions

View file

@ -92,14 +92,10 @@ public:
}
private:
LocatorTextBox(GUI::Widget* parent)
: GUI::TextBox(parent)
{
}
LocatorTextBox() {}
};
Locator::Locator(GUI::Widget* parent)
: GUI::Widget(parent)
Locator::Locator()
{
if (!s_cplusplus_icon) {
s_file_icon = Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-unknown.png");
@ -110,7 +106,7 @@ Locator::Locator(GUI::Widget* parent)
set_layout(make<GUI::VerticalBoxLayout>());
set_size_policy(GUI::SizePolicy::Fill, GUI::SizePolicy::Fixed);
set_preferred_size(0, 20);
m_textbox = LocatorTextBox::construct(this);
m_textbox = add<LocatorTextBox>();
m_textbox->on_change = [this] {
update_suggestions();
};
@ -154,7 +150,7 @@ Locator::Locator(GUI::Widget* parent)
m_popup_window->set_window_type(GUI::WindowType::Tooltip);
m_popup_window->set_rect(0, 0, 500, 200);
m_suggestion_view = GUI::TableView::construct(nullptr);
m_suggestion_view = GUI::TableView::construct();
m_suggestion_view->set_size_columns_to_fit_content(true);
m_suggestion_view->set_headers_visible(false);
m_popup_window->set_main_widget(m_suggestion_view);