From e55d78d53b3b53a2a8159bafba664876712cced4 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Fri, 13 Nov 2020 11:01:44 +0100 Subject: [PATCH] Fixed issue #3664: revert dialog in dark mode shows file list black Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/GitProgressList.cpp | 12 +++++++++++- src/TortoiseProc/GitProgressList.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 5802abb60..392d0b692 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -14,6 +14,7 @@ Released: unreleased * Fixed issue #3651: View Patch window shrinks each time it opens with high DPI * TortoiseGitMerge: Make column index 1 based as most editors are 1-based instead of instead of 0 based * Fixed issue #3662: LogDlg: The "Compare change sets" command is not shown when two commits are adjacent on the list + * Fixed issue #3664: revert dialog in dark mode shows file list black = Release 2.11.0 = Released: 2020-10-10 diff --git a/src/TortoiseProc/GitProgressList.cpp b/src/TortoiseProc/GitProgressList.cpp index 5ffa7675c..c41b5d457 100644 --- a/src/TortoiseProc/GitProgressList.cpp +++ b/src/TortoiseProc/GitProgressList.cpp @@ -536,15 +536,25 @@ UINT CGitProgressList::ProgressThread() if (!m_bFinishedItemAdded) { CString log, str; + COLORREF color; if (bSuccess) + { str.LoadString(IDS_SUCCESS); + if (CTheme::Instance().IsHighContrastMode()) + color = ::GetSysColor(COLOR_WINDOWTEXT); + else + color = CTheme::Instance().IsDarkTheme() ? RGB(0, 178, 255) : RGB(0, 0, 255); + } else + { str.LoadString(IDS_FAIL); + color = CTheme::Instance().IsDarkTheme() ? RGB(207, 47, 47) : RGB(255, 0, 0); + } log.Format(L"%s (%lu ms @ %s)", static_cast(str), time, static_cast(CLoglistUtils::FormatDateAndTime(CTime::GetCurrentTime(), DATE_SHORTDATE, true, false))); // there's no "finished: xxx" line at the end. We add one here to make // sure the user sees that the command is actually finished. - ReportString(log, CString(MAKEINTRESOURCE(IDS_PROGRS_FINISHED)), bSuccess? RGB(0,0,255) : RGB(255,0,0)); + ReportString(log, CString(MAKEINTRESOURCE(IDS_PROGRS_FINISHED)), !(CTheme::Instance().IsHighContrastMode() && bSuccess), color); } int count = GetItemCount(); diff --git a/src/TortoiseProc/GitProgressList.h b/src/TortoiseProc/GitProgressList.h index 9135d8d4d..199d94276 100644 --- a/src/TortoiseProc/GitProgressList.h +++ b/src/TortoiseProc/GitProgressList.h @@ -89,7 +89,7 @@ public: { public: NotificationData() - : color(CTheme::Instance().IsDarkTheme() ? CTheme::darkTextColor : GetSysColor(COLOR_WINDOWTEXT)) + : color(::GetSysColor(COLOR_WINDOWTEXT)) , colorIsDirect(false) , bAuxItem(false) {}; -- 2.11.4.GIT