diff options
| author | Mike Skec <skec@protonmail.ch> | 2020-12-31 16:48:22 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-31 10:57:55 +0100 |
| commit | 0ab1c12b436f4363d03ace1420b91cba1b9b0d50 (patch) | |
| tree | ce6bcd003eb3be699340b831813b3e92c33526df /src | |
| parent | 8f1de0d980deeeb6e697548ff0ae62d1eee662b8 (diff) | |
| download | kristall-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')
| -rw-r--r-- | src/browsertab.cpp | 3 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 15 | ||||
| -rw-r--r-- | src/mainwindow.hpp | 2 |
3 files changed, 18 insertions, 2 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index 1446f20..549f41a 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -1138,7 +1138,8 @@ void BrowserTab::updateUrlBarStyle() // or has an invalid URL. if (this->ui->url_bar->hasFocus() || !url.isValid() || - this->is_internal_location) + this->is_internal_location || + mainWindow->settings_visible) { // Disable styling setLineEditTextFormat(this->ui->url_bar, 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(); } diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp index 6ac1066..f816281 100644 --- a/src/mainwindow.hpp +++ b/src/mainwindow.hpp @@ -101,6 +101,8 @@ private: public: QApplication * application; + + bool settings_visible; private: Ui::MainWindow *ui; |
