aboutsummaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2020-12-31 16:48:22 +1100
committerFelix Queißner <felix@ib-queissner.de>2020-12-31 10:57:55 +0100
commit0ab1c12b436f4363d03ace1420b91cba1b9b0d50 (patch)
treece6bcd003eb3be699340b831813b3e92c33526df /src/mainwindow.cpp
parent8f1de0d980deeeb6e697548ff0ae62d1eee662b8 (diff)
downloadkristall-0ab1c12b436f4363d03ace1420b91cba1b9b0d50.tar.gz
Prevents URL bar styles appearing strange in settings dialog after changing theme.
do this by removing style while settings window is open
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp15
1 files changed, 14 insertions, 1 deletions
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();
}