mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 06:48:12 +00:00
LibGUI: Use GUI::Window::set_main_widget<WidgetType>() in clients
This commit is contained in:
parent
4697195645
commit
0f3e57a6fb
37 changed files with 203 additions and 246 deletions
|
@ -64,13 +64,12 @@ int main(int argc, char** argv)
|
|||
auto document = parse_html_document(html);
|
||||
|
||||
auto window = GUI::Window::construct();
|
||||
auto widget = HtmlView::construct();
|
||||
widget->set_document(document);
|
||||
if (!widget->document()->title().is_null())
|
||||
window->set_title(String::format("%s - HTML", widget->document()->title().characters()));
|
||||
auto& widget = window->set_main_widget<HtmlView>();
|
||||
widget.set_document(document);
|
||||
if (!widget.document()->title().is_null())
|
||||
window->set_title(String::format("%s - HTML", widget.document()->title().characters()));
|
||||
else
|
||||
window->set_title("HTML");
|
||||
window->set_main_widget(widget);
|
||||
window->show();
|
||||
|
||||
auto menubar = make<GUI::MenuBar>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue