aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/fontsettingspage.cpp
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@qt.io>2022-09-30 18:45:35 +0200
committerJarek Kobus <jaroslaw.kobus@qt.io>2022-10-07 07:42:22 +0000
commitbc4c1faf73d6ac9f79cc662dca695dd21ed9e6eb (patch)
tree118784bbaf23ab3291da5b60d0833c840230d53c /src/plugins/texteditor/fontsettingspage.cpp
parent0c39484b600254f5ce50f222563991624575d129 (diff)
Fix logical XOR
The '^' is the bitwise XOR, we should use logical XOR in these contexts. The operator!=() should serve for it. More info and reasoning: https://stackoverflow.com/questions/24542 Change-Id: I1bd70bdcab25455f409594f0f14c209d1de11d18 Reviewed-by: David Schulz <david.schulz@qt.io> Reviewed-by: hjk <hjk@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Diffstat (limited to 'src/plugins/texteditor/fontsettingspage.cpp')
-rw-r--r--src/plugins/texteditor/fontsettingspage.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/texteditor/fontsettingspage.cpp b/src/plugins/texteditor/fontsettingspage.cpp
index 063f2047b6..bf1500d5ee 100644
--- a/src/plugins/texteditor/fontsettingspage.cpp
+++ b/src/plugins/texteditor/fontsettingspage.cpp
@@ -406,8 +406,8 @@ QColor FormatDescription::defaultBackground(TextStyle id)
smallRatio = .05;
largeRatio = .4;
}
- const qreal ratio = ((palette.color(QPalette::Text).value() < 128)
- ^ (palette.color(QPalette::HighlightedText).value() < 128)) ? smallRatio : largeRatio;
+ const qreal ratio = ((palette.color(QPalette::Text).value() < 128) !=
+ (palette.color(QPalette::HighlightedText).value() < 128)) ? smallRatio : largeRatio;
const QColor &col = QColor::fromRgbF(fg.redF() * ratio + bg.redF() * (1 - ratio),
fg.greenF() * ratio + bg.greenF() * (1 - ratio),