1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:17:44 +00:00

Ladybird: Show the web page title in the window titlebar :^)

This commit is contained in:
Andreas Kling 2022-07-04 02:11:58 +02:00 committed by Andrew Kaster
parent 8b7000e151
commit f5d033b8ba
4 changed files with 13 additions and 1 deletions

View file

@ -19,9 +19,18 @@ BrowserWindow::BrowserWindow()
QObject::connect(m_view, &WebView::loadStarted, m_location_edit, &QLineEdit::setText);
QObject::connect(m_location_edit, &QLineEdit::returnPressed, this, &BrowserWindow::location_edit_return_pressed);
QObject::connect(m_view, &WebView::title_changed, this, &BrowserWindow::page_title_changed);
}
void BrowserWindow::location_edit_return_pressed()
{
view().load(m_location_edit->text().toUtf8().data());
}
void BrowserWindow::page_title_changed(QString title)
{
if (title.isEmpty())
setWindowTitle("Ladybird");
else
setWindowTitle(QString("%1 - Ladybird").arg(title));
}