aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Skec <skec@protonmail.ch>2021-01-02 12:54:16 +1100
committerFelix Queißner <felix@ib-queissner.de>2021-01-02 12:41:49 +0100
commit90e20d2c047ae1d9527e15267e62dbc8349e7bb3 (patch)
treedbb5e1da6491c0915f2e928aaca552131f70a46f /src
parent05df68b1331dbfdf9aff98139a9a1f96f147e651 (diff)
downloadkristall-90e20d2c047ae1d9527e15267e62dbc8349e7bb3.tar.gz
Get rid of unneeded hacky code for fancy url bar
Diffstat (limited to 'src')
-rw-r--r--src/browsertab.cpp5
-rw-r--r--src/main.cpp3
-rw-r--r--src/mainwindow.cpp17
-rw-r--r--src/mainwindow.hpp1
4 files changed, 7 insertions, 19 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp
index b20d538..3390679 100644
--- a/src/browsertab.cpp
+++ b/src/browsertab.cpp
@@ -706,6 +706,8 @@ void BrowserTab::renderPage(const QByteArray &data, const MimeType &mime)
emit this->locationChanged(this->current_location);
this->updateUI();
+
+ this->updateUrlBarStyle();
}
void BrowserTab::rerenderPage()
@@ -1141,8 +1143,7 @@ void BrowserTab::updateUrlBarStyle()
if (!kristall::options.fancy_urlbar ||
this->ui->url_bar->hasFocus() ||
!url.isValid() ||
- this->is_internal_location ||
- mainWindow->settings_visible)
+ this->is_internal_location)
{
// Disable styling
if (!this->no_url_style)
diff --git a/src/main.cpp b/src/main.cpp
index ce64040..a953411 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -460,6 +460,9 @@ void kristall::setTheme(Theme theme)
kristall::options.fancy_urlbar_dim_colour = QColor(150, 150, 150, 255);
}
+
+ if (main_window && main_window->curTab())
+ main_window->curTab()->updateUrlBarStyle();
}
void kristall::setUiDensity(UIDensity density, bool previewing)
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 0649f44..0a818c9 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -21,7 +21,6 @@
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)),
@@ -307,24 +306,12 @@ 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 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);
this->setUiDensity(kristall::options.ui_density, false);
- update_url_style(false);
return;
}
- update_url_style(false);
-
kristall::trust::gemini = dialog.geminiSslTrust();
kristall::trust::https = dialog.httpsSslTrust();
kristall::options = dialog.options();
@@ -341,9 +328,7 @@ void MainWindow::on_actionSettings_triggered()
// changes are instantly applied.
for (int i = 0; i < this->ui->browser_tabs->count(); ++i)
{
- BrowserTab * tab = this->tabAt(i);
- tab->needs_rerender = true;
- tab->updateUrlBarStyle();
+ this->tabAt(i)->needs_rerender = true;
}
// Re-render the currently-open tab if we have one.
BrowserTab * tab = this->curTab();
diff --git a/src/mainwindow.hpp b/src/mainwindow.hpp
index 1ac550b..49e2c84 100644
--- a/src/mainwindow.hpp
+++ b/src/mainwindow.hpp
@@ -106,7 +106,6 @@ private:
public:
QApplication * application;
- bool settings_visible;
private:
Ui::MainWindow *ui;