1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 06:37:36 +00:00

WebContent: Plumb title changes over to the WebContentView

WebContentView now fires its on_title_change hook, like Web::PageView.
We use this in the WebView test app to update the window title. :^)
This commit is contained in:
Andreas Kling 2020-07-04 23:40:17 +02:00
parent 7cb7bcb924
commit c15f9e7593
8 changed files with 30 additions and 1 deletions

View file

@ -35,10 +35,14 @@ int main(int argc, char** argv)
auto app = GUI::Application::construct(argc, argv);
auto window = GUI::Window::construct();
auto& view = window->set_main_widget<WebContentView>();
window->set_title("WebContentView");
window->set_title("WebView");
window->set_rect(100, 100, 640, 480);
window->show();
view.on_title_change = [&](auto& title) {
window->set_title(String::format("%s - WebView", title.characters()));
};
view.load("file:///res/html/misc/welcome.html");
return app->exec();