diff options
| author | Mike Skec <skec@protonmail.ch> | 2020-12-31 20:25:06 +1100 |
|---|---|---|
| committer | Felix Queißner <felix@ib-queissner.de> | 2020-12-31 10:57:55 +0100 |
| commit | b2e099a56b3d5e7ed4115c4026b60b27ab78b1dc (patch) | |
| tree | 3ba75150f00b6414b9ee222e498451f801ad42ae /src | |
| parent | 96ad0e78f11f70b14c9c39fc11aac9196f13727d (diff) | |
| download | kristall-b2e099a56b3d5e7ed4115c4026b60b27ab78b1dc.tar.gz | |
urlbar styling: only remove styles if not already removed
Diffstat (limited to 'src')
| -rw-r--r-- | src/browsertab.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/browsertab.cpp b/src/browsertab.cpp index f98a0f2..18ec5cc 100644 --- a/src/browsertab.cpp +++ b/src/browsertab.cpp @@ -1136,6 +1136,7 @@ void BrowserTab::updateUrlBarStyle() // Set all text to default colour if url bar // is focused, is at an internal location (like about:...), // or has an invalid URL. + static bool no_style = false; if (!kristall::options.fancy_urlbar || this->ui->url_bar->hasFocus() || !url.isValid() || @@ -1143,11 +1144,17 @@ void BrowserTab::updateUrlBarStyle() mainWindow->settings_visible) { // Disable styling - setLineEditTextFormat(this->ui->url_bar, - QList<QTextLayout::FormatRange>()); + if (!no_style) + { + setLineEditTextFormat(this->ui->url_bar, + QList<QTextLayout::FormatRange>()); + no_style = true; + } return; } + no_style = false; + // Styling enabled: 'authority' (hostname, port, etc) of // the URL is highlighted (i.e default colour), // the rest is in grey-ish colour @@ -1170,7 +1177,6 @@ void BrowserTab::updateUrlBarStyle() QTextCharFormat f; f.setForeground(mainWindow->palette().color(QPalette::PlaceholderText)); - // Create format range for left-side of URL QTextLayout::FormatRange fr_left; fr_left.start = 0; |
