aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2018-04-17 15:34:12 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2018-04-17 15:34:12 +0200
commita40aa6b55deea00c313cb7941b8c158139b4e446 (patch)
treebeab90e7bc384457a7d65f41b3887ad761bd956f
parentClean up UrlLineEdit (diff)
downloadsmolbote-a40aa6b55deea00c313cb7941b8c158139b4e446.tar.xz
Clear navigation bar and address bar when last subwindow is closed
-rw-r--r--src/mainwindow/mainwindow.cpp7
1 files changed, 6 insertions, 1 deletions
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<Configuration> &config, QWidget *parent)
disconnect(navigationBarConnection);
auto *w = qobject_cast<Window *>(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);