diff options
author | Gerald Combs <gerald@wireshark.org> | 2019-11-18 11:12:43 -0800 |
---|---|---|
committer | Roland Knall <rknall@gmail.com> | 2019-11-18 21:23:51 +0000 |
commit | 5b78bbfc027e9b8fb6617009a2be486efad5ca86 (patch) | |
tree | 28cd0abbbd051cfa30359b4ee10d2822adb509ca | |
parent | e8ef656842b5853d99aeee1e515bb23c322fde5f (diff) |
Qt: Update ColorUtils::themeLinkBrush.
Qt 5.12.6 fixed the dark mode link color on macOS. Update themeLinkBrush
accordingly.
Ping-Bug: 15511
Change-Id: I9d89bf3ef9c8a9b8c14dc5f435b9cdbb30fca2aa
Reviewed-on: https://code.wireshark.org/review/35126
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
-rw-r--r-- | ui/qt/utils/color_utils.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ui/qt/utils/color_utils.cpp b/ui/qt/utils/color_utils.cpp index 4f584e4cee..2fe6cbbcc5 100644 --- a/ui/qt/utils/color_utils.cpp +++ b/ui/qt/utils/color_utils.cpp @@ -146,23 +146,25 @@ bool ColorUtils::themeIsDark() return wsApp->palette().windowText().color().lightness() > wsApp->palette().window().color().lightness(); } -// As of 5.12.3, Qt always uses Qt::blue for the link color, which is +// Qt < 5.12.6 on macOS always uses Qt::blue for the link color, which is // unreadable when using a dark theme. Changing the application palette // via ...Application::setPalette is problematic, since QGuiApplication // sets a flag (ApplicationPaletteExplicitlySet) which keeps us from // catching theme changes. // // themeLinkBrush and themeLinkStyle provide convenience routines for -// fetching the link brush and style. We can remove them if Qt ever fixes -// the link color. +// fetching the link brush and style. // // We could also override WiresharkApplication::palette, but keeping the // routines together here seemed to make more sense. QBrush ColorUtils::themeLinkBrush() { +#if QT_VERSION < QT_VERSION_CHECK(5, 12, 6) + // https://bugreports.qt.io/browse/QTBUG-71740 if (themeIsDark()) { return QBrush(tango_sky_blue_2); } +#endif return wsApp->palette().link(); } |