From 0ab1c12b436f4363d03ace1420b91cba1b9b0d50 Mon Sep 17 00:00:00 2001 From: Mike Skec Date: Thu, 31 Dec 2020 16:48:22 +1100 Subject: Prevents URL bar styles appearing strange in settings dialog after changing theme. do this by removing style while settings window is open --- src/mainwindow.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index f59b110..5f2a7d2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -21,6 +21,7 @@ MainWindow::MainWindow(QApplication * app, QWidget *parent) : QMainWindow(parent), application(app), + settings_visible(false), ui(new Ui::MainWindow), url_status(new ElideLabel(this)), file_size(new QLabel(this)), @@ -289,11 +290,23 @@ void MainWindow::on_actionSettings_triggered() dialog.setGeminiSslTrust(kristall::trust::gemini); 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(); + if(dialog.exec() != QDialog::Accepted) { kristall::setTheme(kristall::options.theme); + + settings_visible = false; + this->curTab()->updateUrlBarStyle(); + return; } + settings_visible = false; + kristall::trust::gemini = dialog.geminiSslTrust(); kristall::trust::https = dialog.httpsSslTrust(); kristall::options = dialog.options(); @@ -309,7 +322,7 @@ void MainWindow::on_actionSettings_triggered() // changes are instantly applied. for (int i = 0; i < this->ui->browser_tabs->count(); ++i) { - BrowserTab * tab = tabAt(i); + BrowserTab * tab = this->tabAt(i); tab->needs_rerender = true; tab->updateUrlBarStyle(); } -- cgit v1.2.3