diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-09-29 16:26:28 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-09-29 16:26:28 +0200 |
commit | 8d822ff82bd5da9b89375628710532d2622fec32 (patch) | |
tree | f64b8376603b9d97d83b76cc1c20db6f15401fe4 | |
parent | b94c7665a9ecbe6c5b5d81cd62d21787e6ff4d7e (diff) | |
download | serenity-8d822ff82bd5da9b89375628710532d2622fec32.zip |
html: Set the window title based on the HTML document's title
If the loaded document has a <title>, we now show that in the app's
window title bar! :^)
-rw-r--r-- | Userland/html.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Userland/html.cpp b/Userland/html.cpp index f2d85d51a0..5a28f240a5 100644 --- a/Userland/html.cpp +++ b/Userland/html.cpp @@ -41,7 +41,10 @@ int main(int argc, char** argv) auto window = GWindow::construct(); auto widget = HtmlView::construct(); widget->set_document(document); - window->set_title("HTML"); + 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(); |