mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-10 13:00:29 +03:00
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! :^)
This commit is contained in:
parent
b94c7665a9
commit
8d822ff82b
Notes:
sideshowbarker
2024-07-19 11:53:28 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/8d822ff82bd
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user