aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5f2a7d2..f9266bc 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -291,21 +291,21 @@ void MainWindow::on_actionSettings_triggered()
dialog.setHttpsSslTrust(kristall::trust::https);
// We use this to disable url bar styling
- // while we view settings, so that theme
- // stays applied.
- settings_visible = true;
- this->curTab()->updateUrlBarStyle();
+ // while we view Settings dialog, so that the URL bar
+ // doesn't look weird after changing theme.
+ static const auto update_url_style = [this](bool vis) {
+ this->settings_visible = vis;
+ if (this->curTab()) this->curTab()->updateUrlBarStyle();
+ };
+ update_url_style(true);
if(dialog.exec() != QDialog::Accepted) {
kristall::setTheme(kristall::options.theme);
-
- settings_visible = false;
- this->curTab()->updateUrlBarStyle();
-
+ update_url_style(false);
return;
}
- settings_visible = false;
+ update_url_style(false);
kristall::trust::gemini = dialog.geminiSslTrust();
kristall::trust::https = dialog.httpsSslTrust();