Qt: Fix our ColorUtils::themeIsDark comparison.

Change-Id: Ice109cdd5451b67651f10da7e4001d6d4cb0c7f0
Reviewed-on: https://code.wireshark.org/review/32506
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Gerald Combs 2019-03-21 16:48:27 -07:00 committed by Anders Broman
parent 029f24e4cf
commit c287fe2853
2 changed files with 7 additions and 1 deletions

View File

@ -143,7 +143,7 @@ QRgb ColorUtils::sequenceColor(int item)
bool ColorUtils::themeIsDark()
{
return wsApp->palette().windowText().color().lightness() < wsApp->palette().text().color().lightness();
return wsApp->palette().windowText().color().lightness() > wsApp->palette().window().color().lightness();
}
/*

View File

@ -45,6 +45,12 @@ public:
static QRgb graphColor(int item);
static QRgb sequenceColor(int item);
/** Checks if our application is in "dark mode".
* Dark mode is determined by comparing the application palette's window
* text color with the window color.
*
* @return true if we're running in dark mode, false otherwise.
*/
static bool themeIsDark();
signals: