From a40aa6b55deea00c313cb7941b8c158139b4e446 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Tue, 17 Apr 2018 15:34:12 +0200 Subject: Clear navigation bar and address bar when last subwindow is closed --- src/mainwindow/mainwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow/mainwindow.cpp b/src/mainwindow/mainwindow.cpp index df5e1c8..b68ddbe 100644 --- a/src/mainwindow/mainwindow.cpp +++ b/src/mainwindow/mainwindow.cpp @@ -60,7 +60,12 @@ MainWindow::MainWindow(std::shared_ptr &config, QWidget *parent) disconnect(navigationBarConnection); auto *w = qobject_cast(window); - if(w != nullptr) { + if(w == nullptr) { + // no current subwindow, clear everything + setWindowTitle(tr("smolbote")); + addressBar->connectWebView(nullptr); + navigationToolBar->connectWebView(nullptr); + } else { setWindowTitle(w->windowTitle() + titleSuffix); titleChangedConnection = connect(w, &Window::windowTitleChanged, this, [this](const QString &title) { this->setWindowTitle(title + titleSuffix); -- cgit v1.2.1