• R/O
  • SSH
  • HTTPS

tortoisesvn: 提交


Commit MetaInfo

修订版28755 (tree)
时间2020-02-22 04:31:54
作者stefankueng

Log Message

Handle high-contrast mode in TortoiseProc.

更改概述

差异

--- trunk/src/SVN/SVNStatusListCtrl.cpp (revision 28754)
+++ trunk/src/SVN/SVNStatusListCtrl.cpp (revision 28755)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2018 - TortoiseSVN
3+// Copyright (C) 2003-2018, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -55,6 +55,7 @@
5555 #include "DiffOptionsDlg.h"
5656 #include "RecycleBinDlg.h"
5757 #include "BrowseFolder.h"
58+#include "Theme.h"
5859
5960 #include <tuple>
6061 #include <strsafe.h>
@@ -301,6 +302,7 @@
301302 ON_NOTIFY_REFLECT(LVN_ITEMCHANGING, &CSVNStatusListCtrl::OnLvnItemchanging)
302303 ON_REGISTERED_MESSAGE(WM_RESOLVEMSG, &CSVNStatusListCtrl::OnResolveMsg)
303304 ON_REGISTERED_MESSAGE(WM_REFRESH_STATUS_MSG, &CSVNStatusListCtrl::OnRefreshStatusMsg)
305+ ON_WM_SYSCOLORCHANGE()
304306 END_MESSAGE_MAP()
305307
306308
@@ -368,6 +370,7 @@
368370 , m_pContextMenu(nullptr)
369371 , m_hShellMenu(0)
370372 , m_uiFont(0)
373+ , m_nBackgroundImageID(0)
371374 {
372375 m_tooltipbuf[0] = 0;
373376 NONCLIENTMETRICS metrics = { 0 };
@@ -518,6 +521,7 @@
518521
519522 bool CSVNStatusListCtrl::SetBackgroundImage(UINT nID)
520523 {
524+ m_nBackgroundImageID = nID;
521525 return CAppUtils::SetListCtrlBackgroundImage(GetSafeHwnd(), nID);
522526 }
523527
@@ -4872,7 +4876,7 @@
48724876 // Tell Windows to send draw notifications for each subitem.
48734877 *pResult = CDRF_NOTIFYSUBITEMDRAW;
48744878
4875- COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);
4879+ COLORREF crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_WINDOWTEXT));
48764880
48774881 if (m_arListArray.size() > (DWORD_PTR)pLVCD->nmcd.dwItemSpec)
48784882 {
@@ -4893,33 +4897,33 @@
48934897 case svn_wc_status_added:
48944898 if (entry->remotestatus > svn_wc_status_unversioned)
48954899 // locally added file, but file already exists in repository!
4896- crText = m_Colors.GetColor(CColors::Conflict);
4900+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Conflict), true);
48974901 else
4898- crText = m_Colors.GetColor(CColors::Added);
4902+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Added), true);
48994903 break;
49004904 case svn_wc_status_missing:
49014905 case svn_wc_status_deleted:
49024906 case svn_wc_status_replaced:
4903- crText = m_Colors.GetColor(CColors::Deleted);
4907+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Deleted), true);
49044908 break;
49054909 case svn_wc_status_modified:
49064910 if (entry->remotestatus == svn_wc_status_modified)
49074911 // indicate a merge (both local and remote changes will require a merge)
4908- crText = m_Colors.GetColor(CColors::Merged);
4912+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Merged), true);
49094913 else if (entry->remotestatus == svn_wc_status_deleted)
49104914 // locally modified, but already deleted in the repository
4911- crText = m_Colors.GetColor(CColors::Conflict);
4915+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Conflict), true);
49124916 else if (entry->status == svn_wc_status_missing)
4913- crText = m_Colors.GetColor(CColors::Deleted);
4917+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Deleted), true);
49144918 else
4915- crText = m_Colors.GetColor(CColors::Modified);
4919+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Modified), true);
49164920 break;
49174921 case svn_wc_status_merged:
4918- crText = m_Colors.GetColor(CColors::Merged);
4922+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Merged), true);
49194923 break;
49204924 case svn_wc_status_conflicted:
49214925 case svn_wc_status_obstructed:
4922- crText = m_Colors.GetColor(CColors::Conflict);
4926+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Conflict), true);
49234927 break;
49244928 case svn_wc_status_none:
49254929 case svn_wc_status_unversioned:
@@ -4928,16 +4932,16 @@
49284932 case svn_wc_status_normal:
49294933 case svn_wc_status_external:
49304934 default:
4931- crText = GetSysColor(COLOR_WINDOWTEXT);
4935+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_WINDOWTEXT));
49324936 break;
49334937 }
49344938
49354939 if (entry->isConflicted)
4936- crText = m_Colors.GetColor(CColors::Conflict);
4940+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Conflict), true);
49374941
49384942 if ((m_dwShow & SVNSLC_SHOWEXTDISABLED)&&(entry->IsFromDifferentRepository() || entry->IsNested() || (!m_bAllowPeggedExternals && entry->IsPeggedExternal())))
49394943 {
4940- crText = GetSysColor(COLOR_GRAYTEXT);
4944+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
49414945 }
49424946
49434947 if (!entry->onlyMergeInfoModsKnown)
@@ -5415,12 +5419,12 @@
54155419 else
54165420 str = m_sEmpty;
54175421 }
5418- COLORREF clrText = ::GetSysColor(COLOR_WINDOWTEXT);
5422+ COLORREF clrText = CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_WINDOWTEXT));
54195423 COLORREF clrTextBk;
54205424 if (IsWindowEnabled())
5421- clrTextBk = ::GetSysColor(COLOR_WINDOW);
5425+ clrTextBk = CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_WINDOW));
54225426 else
5423- clrTextBk = ::GetSysColor(COLOR_3DFACE);
5427+ clrTextBk = CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_3DFACE));
54245428
54255429 CRect rc;
54265430 GetClientRect(&rc);
@@ -5520,6 +5524,13 @@
55205524 CListCtrl::OnDestroy();
55215525 }
55225526
5527+void CSVNStatusListCtrl::OnSysColorChange()
5528+{
5529+ __super::OnSysColorChange();
5530+ CTheme::Instance().OnSysColorChanged();
5531+ SetBackgroundImage(m_nBackgroundImageID);
5532+}
5533+
55235534 void CSVNStatusListCtrl::ShowErrorMessage()
55245535 {
55255536 CFormatMessageWrapper errorDetails;
--- trunk/src/SVN/SVNStatusListCtrl.h (revision 28754)
+++ trunk/src/SVN/SVNStatusListCtrl.h (revision 28755)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2015, 2017-2019 - TortoiseSVN
3+// Copyright (C) 2003-2015, 2017-2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -1043,6 +1043,7 @@
10431043 afx_msg void OnHdnBegintrack(NMHDR *pNMHDR, LRESULT *pResult);
10441044 afx_msg void OnHdnItemchanging(NMHDR *pNMHDR, LRESULT *pResult);
10451045 afx_msg void OnDestroy();
1046+ afx_msg void OnSysColorChange();
10461047 afx_msg LRESULT OnResolveMsg(WPARAM, LPARAM);
10471048 afx_msg LRESULT OnRefreshStatusMsg(WPARAM wParam, LPARAM);
10481049
@@ -1108,6 +1109,7 @@
11081109 bool m_bAllowPeggedExternals;
11091110
11101111 int m_nIconFolder;
1112+ UINT m_nBackgroundImageID;
11111113
11121114 CWnd * m_pStatLabel;
11131115 CButton * m_pSelectButton;
--- trunk/src/TortoiseMerge/MainFrm.cpp (revision 28754)
+++ trunk/src/TortoiseMerge/MainFrm.cpp (revision 28755)
@@ -178,9 +178,9 @@
178178 ON_UPDATE_COMMAND_UI_RANGE(ID_INDICATOR_LEFTTABMODESTART, ID_INDICATOR_LEFTTABMODESTART + 19, &CMainFrame::OnUpdateTabModeLeft)
179179 ON_UPDATE_COMMAND_UI_RANGE(ID_INDICATOR_RIGHTTABMODESTART, ID_INDICATOR_RIGHTTABMODESTART + 19, &CMainFrame::OnUpdateTabModeRight)
180180 ON_UPDATE_COMMAND_UI_RANGE(ID_INDICATOR_BOTTOMTABMODESTART, ID_INDICATOR_BOTTOMTABMODESTART + 19, &CMainFrame::OnUpdateTabModeBottom)
181- ON_WM_SETTINGCHANGE()
182- ON_WM_SYSCOLORCHANGE()
183- END_MESSAGE_MAP()
181+ ON_WM_SETTINGCHANGE()
182+ ON_WM_SYSCOLORCHANGE()
183+END_MESSAGE_MAP()
184184
185185 static UINT indicators[] =
186186 {
--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28754)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28755)
@@ -65,6 +65,7 @@
6565 #include "..\..\ext\snarl\SnarlInterface.h"
6666 #include "ToastNotifications.h"
6767 #include "DPIAware.h"
68+#include "Theme.h"
6869 #include <tlhelp32.h>
6970 #include <shlwapi.h>
7071 #include <fstream>
@@ -390,6 +391,7 @@
390391 ON_WM_QUERYENDSESSION()
391392 ON_REGISTERED_MESSAGE(WM_TaskBarButtonCreated, OnTaskbarButtonCreated)
392393 ON_NOTIFY(LVN_BEGINDRAG, IDC_LOGMSG, &CLogDlg::OnLvnBegindragLogmsg)
394+ ON_WM_SYSCOLORCHANGE()
393395 END_MESSAGE_MAP()
394396
395397 void CLogDlg::SetParams(const CTSVNPath& path, const SVNRev& pegrev, const SVNRev& startrev, const SVNRev& endrev,
@@ -1058,7 +1060,7 @@
10581060 // combine ranges only separated by whitespace
10591061 ReduceRanges(info.ranges, info.text);
10601062
1061- CAppUtils::SetCharFormat(pMsgView, CFM_COLOR, m_Colors.GetColor(CColors::FilterMatch), info.ranges);
1063+ CAppUtils::SetCharFormat(pMsgView, CFM_COLOR, CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::FilterMatch), true), info.ranges);
10621064 }
10631065
10641066 if (((DWORD)CRegStdDWORD(L"Software\\TortoiseSVN\\StyleCommitMessages", TRUE)) == TRUE)
@@ -3451,7 +3453,7 @@
34513453 if (m_bLogThreadRunning)
34523454 return;
34533455
3454- static COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);
3456+ static COLORREF crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_WINDOWTEXT));
34553457
34563458 switch (pLVCD->nmcd.dwDrawStage)
34573459 {
@@ -3468,7 +3470,7 @@
34683470
34693471 // Tell Windows to send draw notifications for each subitem.
34703472 *pResult = CDRF_NOTIFYSUBITEMDRAW;
3471- crText = GetSysColor(COLOR_WINDOWTEXT);
3473+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_WINDOWTEXT));
34723474 if (m_logEntries.GetVisibleCount() > pLVCD->nmcd.dwItemSpec)
34733475 {
34743476 PLOGENTRYDATA data = m_logEntries.GetVisible(pLVCD->nmcd.dwItemSpec);
@@ -3480,14 +3482,14 @@
34803482 // with themes enabled)
34813483 if (!IsAppThemed() ||
34823484 ((pLVCD->nmcd.uItemState & CDIS_HOT) == 0))
3483- pLVCD->clrTextBk = GetSysColor(COLOR_MENU);
3485+ pLVCD->clrTextBk = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_MENU));
34843486 }
34853487 if (data->GetChangedPaths().ContainsCopies())
3486- crText = m_Colors.GetColor(CColors::Modified);
3488+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Modified), true);
34873489 if ((data->GetDepth()) || (m_mergedRevs.find(data->GetRevision()) != m_mergedRevs.end()))
3488- crText = GetSysColor(COLOR_GRAYTEXT);
3490+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
34893491 if ((m_copyfromrev > data->GetRevision()) && !m_mergePath.IsEmpty())
3490- crText = GetSysColor(COLOR_GRAYTEXT);
3492+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
34913493 if ((data->GetRevision() == m_wcRev) || data->GetUnread())
34923494 {
34933495 SelectObject(pLVCD->nmcd.hdc, data->GetUnread() ? m_unreadFont : m_wcRevFont);
@@ -3500,7 +3502,7 @@
35003502 if (m_logEntries.GetVisibleCount() == pLVCD->nmcd.dwItemSpec)
35013503 {
35023504 if (m_bStrictStopped)
3503- crText = GetSysColor(COLOR_GRAYTEXT);
3505+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
35043506 }
35053507 // Store the color back in the NMLVCUSTOMDRAW struct.
35063508 pLVCD->clrText = crText;
@@ -3659,7 +3661,7 @@
36593661 // Tell Windows to send draw notifications for each subitem.
36603662 *pResult = CDRF_NOTIFYSUBITEMDRAW;
36613663
3662- COLORREF crText = GetSysColor(COLOR_WINDOWTEXT);
3664+ COLORREF crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_WINDOWTEXT));
36633665 bool bGrayed = false;
36643666 if ((m_cShowPaths.GetState() & 0x0003) == BST_UNCHECKED)
36653667 {
@@ -3667,7 +3669,7 @@
36673669 {
36683670 if (!m_currentChangedArray[pLVCD->nmcd.dwItemSpec].IsRelevantForStartPath())
36693671 {
3670- crText = GetSysColor(COLOR_GRAYTEXT);
3672+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
36713673 bGrayed = true;
36723674 }
36733675 }
@@ -3675,7 +3677,7 @@
36753677 {
36763678 if (m_currentChangedPathList[pLVCD->nmcd.dwItemSpec].GetSVNPathString().Left(m_sRelativeRoot.GetLength()).Compare(m_sRelativeRoot) != 0)
36773679 {
3678- crText = GetSysColor(COLOR_GRAYTEXT);
3680+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
36793681 bGrayed = true;
36803682 }
36813683 }
@@ -3685,17 +3687,17 @@
36853687 {
36863688 DWORD action = m_currentChangedArray[pLVCD->nmcd.dwItemSpec].GetAction();
36873689 if (action == LOGACTIONS_MODIFIED)
3688- crText = m_Colors.GetColor(CColors::Modified);
3690+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Modified), true);
36893691 if (action == LOGACTIONS_REPLACED)
3690- crText = m_Colors.GetColor(CColors::Deleted);
3692+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Deleted), true);
36913693 if (action == LOGACTIONS_ADDED)
3692- crText = m_Colors.GetColor(CColors::Added);
3694+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Added), true);
36933695 if (action == LOGACTIONS_DELETED)
3694- crText = m_Colors.GetColor(CColors::Deleted);
3696+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Deleted), true);
36953697 if (action == LOGACTIONS_MOVED)
3696- crText = m_Colors.GetColor(CColors::Added);
3698+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Added), true);
36973699 if (action == LOGACTIONS_MOVEREPLACED)
3698- crText = m_Colors.GetColor(CColors::Deleted);
3700+ crText = CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::Deleted), true);
36993701 }
37003702 if (m_currentChangedArray.GetCount() > pLVCD->nmcd.dwItemSpec)
37013703 {
@@ -3704,7 +3706,7 @@
37043706 if ((propsModifies == svn_tristate_true) && (textModifies != svn_tristate_true))
37053707 {
37063708 // property only modification, content of entry hasn't changed: show in gray
3707- crText = GetSysColor(COLOR_GRAYTEXT);
3709+ crText = CTheme::Instance().GetThemeColor(GetSysColor(COLOR_GRAYTEXT));
37083710 }
37093711 }
37103712
@@ -3763,10 +3765,10 @@
37633765 // unfortunately, the pLVCD->nmcd.uItemState does not contain valid
37643766 // information at this drawing stage. But we can check the whether the
37653767 // previous stage changed the background color of the item
3766- if (pLVCD->clrTextBk == GetSysColor(COLOR_MENU))
3768+ if (pLVCD->clrTextBk == CTheme::Instance().GetThemeColor(GetSysColor(COLOR_MENU)))
37673769 {
37683770 HBRUSH brush;
3769- brush = ::CreateSolidBrush(::GetSysColor(COLOR_MENU));
3771+ brush = ::CreateSolidBrush(CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_MENU)));
37703772 if (brush)
37713773 {
37723774 ::FillRect(pLVCD->nmcd.hdc, &rect, brush);
@@ -3791,16 +3793,16 @@
37913793 if (rItem.state & LVIS_SELECTED)
37923794 {
37933795 if (::GetFocus() == listCtrl.m_hWnd)
3794- brush = ::CreateSolidBrush(::GetSysColor(COLOR_HIGHLIGHT));
3796+ brush = ::CreateSolidBrush(CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_HIGHLIGHT)));
37953797 else
3796- brush = ::CreateSolidBrush(::GetSysColor(COLOR_BTNFACE));
3798+ brush = ::CreateSolidBrush(CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_BTNFACE)));
37973799 }
37983800 else
37993801 {
38003802 if (pLogEntry && pLogEntry->GetChangedPaths().ContainsSelfCopy())
3801- brush = ::CreateSolidBrush(::GetSysColor(COLOR_MENU));
3803+ brush = ::CreateSolidBrush(CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_MENU)));
38023804 else
3803- brush = ::CreateSolidBrush(::GetSysColor(COLOR_WINDOW));
3805+ brush = ::CreateSolidBrush(CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_WINDOW)));
38043806 }
38053807 if (brush == NULL)
38063808 return rect;
@@ -3944,9 +3946,9 @@
39443946 if ((item.state & LVIS_SELECTED) && !IsAppThemed())
39453947 {
39463948 if (::GetFocus() == listCtrl.GetSafeHwnd())
3947- textColor = ::GetSysColor(COLOR_HIGHLIGHTTEXT);
3949+ textColor = CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_HIGHLIGHTTEXT));
39483950 else
3949- textColor = ::GetSysColor(COLOR_WINDOWTEXT);
3951+ textColor = CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_WINDOWTEXT));
39503952 }
39513953 SetTextColor(pLVCD->nmcd.hdc, textColor);
39523954 SetBkMode(pLVCD->nmcd.hdc, TRANSPARENT);
@@ -3965,7 +3967,7 @@
39653967 drawPos = it->cpMin;
39663968 if (it->cpMax - drawPos)
39673969 {
3968- SetTextColor(pLVCD->nmcd.hdc, m_Colors.GetColor(CColors::FilterMatch));
3970+ SetTextColor(pLVCD->nmcd.hdc, CTheme::Instance().GetThemeColor(m_Colors.GetColor(CColors::FilterMatch), true));
39693971 DrawText(pLVCD->nmcd.hdc, text.substr(drawPos).c_str(), it->cpMax - drawPos, &rc,
39703972 DT_SINGLELINE | DT_VCENTER | DT_NOPREFIX | DT_END_ELLIPSIS);
39713973 DrawText(pLVCD->nmcd.hdc, text.substr(drawPos).c_str(), it->cpMax - drawPos, &rc,
@@ -9888,3 +9890,11 @@
98889890 pdsrc.release();
98899891 pdobj->Release();
98909892 }
9893+
9894+void CLogDlg::OnSysColorChange()
9895+{
9896+ __super::OnSysColorChange();
9897+ CTheme::Instance().OnSysColorChanged();
9898+ SendDlgItemMessage(IDC_MSGVIEW, WM_SYSCOLORCHANGE, 0, 0);
9899+ CMFCVisualManager::GetInstance()->RedrawAll();
9900+}
--- trunk/src/TortoiseProc/LogDialog/LogDlg.h (revision 28754)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.h (revision 28755)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2018 - TortoiseSVN
3+// Copyright (C) 2003-2018, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -239,6 +239,7 @@
239239 afx_msg BOOL OnQueryEndSession();
240240 afx_msg LRESULT OnTaskbarButtonCreated(WPARAM wParam, LPARAM lParam);
241241 afx_msg void OnLvnBegindragLogmsg(NMHDR *pNMHDR, LRESULT *pResult);
242+ afx_msg void OnSysColorChange();
242243
243244 virtual void OnCancel();
244245 virtual void OnOK();
--- trunk/src/TortoiseProc/RepositoryBrowser.cpp (revision 28754)
+++ trunk/src/TortoiseProc/RepositoryBrowser.cpp (revision 28755)
@@ -172,6 +172,7 @@
172172 , oldx(0)
173173 , m_nBookmarksIcon(0)
174174 , m_bTrySVNParentPath(true)
175+ , m_nBackgroundImageID(0)
175176 {
176177 ConstructorInit(rev);
177178 }
@@ -308,6 +309,7 @@
308309 ON_NOTIFY(NM_CUSTOMDRAW, IDC_REPOTREE, &CRepositoryBrowser::OnNMCustomdrawRepotree)
309310 ON_NOTIFY(TVN_ITEMCHANGING, IDC_REPOTREE, &CRepositoryBrowser::OnTvnItemChangingRepotree)
310311 ON_NOTIFY(NM_SETCURSOR, IDC_REPOTREE, &CRepositoryBrowser::OnNMSetCursorRepotree)
312+ ON_WM_SYSCOLORCHANGE()
311313 END_MESSAGE_MAP()
312314
313315 SVNRev CRepositoryBrowser::GetRevision() const
@@ -718,7 +720,10 @@
718720 nID = IDI_REPO_FILE;
719721
720722 if (IsAppThemed())
723+ {
724+ m_nBackgroundImageID = nID;
721725 CAppUtils::SetListCtrlBackgroundImage(m_RepoList.GetSafeHwnd(), nID);
726+ }
722727 }
723728 }
724729
@@ -915,6 +920,13 @@
915920 return 0;
916921 }
917922
923+void CRepositoryBrowser::OnSysColorChange()
924+{
925+ __super::OnSysColorChange();
926+ CTheme::Instance().OnSysColorChanged();
927+ CAppUtils::SetListCtrlBackgroundImage(m_RepoList.GetSafeHwnd(), m_nBackgroundImageID);
928+}
929+
918930 void CRepositoryBrowser::OnBnClickedHelp()
919931 {
920932 OnHelp();
--- trunk/src/TortoiseProc/RepositoryBrowser.h (revision 28754)
+++ trunk/src/TortoiseProc/RepositoryBrowser.h (revision 28755)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2018 - TortoiseSVN
3+// Copyright (C) 2003-2018, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -165,6 +165,7 @@
165165 afx_msg void OnTvnItemChangingRepotree(NMHDR *pNMHDR, LRESULT *pResult);
166166 afx_msg void OnNMSetCursorRepotree(NMHDR *pNMHDR, LRESULT *pResult);
167167 afx_msg LRESULT OnAuthCancelled(WPARAM wParam, LPARAM lParam);
168+ afx_msg void OnSysColorChange();
168169
169170 afx_msg void OnUrlFocus();
170171 afx_msg void OnCopy();
@@ -339,6 +340,7 @@
339340 int m_nOpenIconFolder;
340341 int m_nExternalOvl;
341342 int m_nSVNParentPath;
343+ UINT m_nBackgroundImageID;
342344
343345 volatile int m_blockEvents;
344346
--- trunk/src/TortoiseProc/SVNProgressDlg.cpp (revision 28754)
+++ trunk/src/TortoiseProc/SVNProgressDlg.cpp (revision 28755)
@@ -50,8 +50,9 @@
5050 #include "SmartHandle.h"
5151 #include "RecycleBinDlg.h"
5252 #include "BrowseFolder.h"
53+#include "SimplePrompt.h"
54+#include "Theme.h"
5355 #include <strsafe.h>
54-#include "SimplePrompt.h"
5556
5657 BOOL CSVNProgressDlg::m_bAscending = FALSE;
5758 int CSVNProgressDlg::m_nSortedColumn = -1;
@@ -125,6 +126,7 @@
125126 , sDryRun(MAKEINTRESOURCE(IDS_PROGRS_DRYRUN))
126127 , sRecordOnly(MAKEINTRESOURCE(IDS_MERGE_RECORDONLY))
127128 , sForce(MAKEINTRESOURCE(IDS_MERGE_FORCE))
129+ , m_nBackgroundImageID(0)
128130 {
129131 m_bHideExternalInfo = !!CRegStdDWORD(L"Software\\TortoiseSVN\\HideExternalInfo", TRUE);
130132 m_columnbuf[0] = 0;
@@ -167,6 +169,7 @@
167169 ON_BN_CLICKED(IDC_RETRYDIFFERENTUSER, &CSVNProgressDlg::OnBnClickedRetryDifferentUser)
168170 ON_REGISTERED_MESSAGE(CLinkControl::LK_LINKITEMCLICKED, &CSVNProgressDlg::OnCheck)
169171 ON_REGISTERED_MESSAGE(WM_RESOLVEMSG, &CSVNProgressDlg::OnResolveMsg)
172+ ON_WM_SYSCOLORCHANGE()
170173 END_MESSAGE_MAP()
171174
172175 BOOL CSVNProgressDlg::Cancel()
@@ -1205,6 +1208,7 @@
12051208
12061209 bool CSVNProgressDlg::SetBackgroundImage(UINT nID)
12071210 {
1211+ m_nBackgroundImageID = nID;
12081212 return CAppUtils::SetListCtrlBackgroundImage(m_ProgList.GetSafeHwnd(), nID);
12091213 }
12101214
@@ -1808,7 +1812,7 @@
18081812 return;
18091813
18101814 // Store the color back in the NMLVCUSTOMDRAW struct.
1811- pLVCD->clrText = data->color;
1815+ pLVCD->clrText = CTheme::Instance().GetThemeColor(data->color, true);
18121816 if (data->bBold)
18131817 {
18141818 SelectObject(pLVCD->nmcd.hdc, m_boldFont);
@@ -1982,6 +1986,13 @@
19821986 return 0;
19831987 }
19841988
1989+void CSVNProgressDlg::OnSysColorChange()
1990+{
1991+ __super::OnSysColorChange();
1992+ CTheme::Instance().OnSysColorChanged();
1993+ CAppUtils::SetListCtrlBackgroundImage(m_ProgList.GetSafeHwnd(), m_nBackgroundImageID);
1994+}
1995+
19851996 void CSVNProgressDlg::Sort()
19861997 {
19871998 if(m_arData.size() < 2)
--- trunk/src/TortoiseProc/SVNProgressDlg.h (revision 28754)
+++ trunk/src/TortoiseProc/SVNProgressDlg.h (revision 28755)
@@ -28,6 +28,7 @@
2828 #include "LinkControl.h"
2929 #include "Hooks.h"
3030 #include "LogDialog/LogDlgDataModel.h"
31+#include "Theme.h"
3132
3233 class CCmdLineParser;
3334
@@ -169,7 +170,7 @@
169170 , content_state(svn_wc_notify_state_inapplicable)
170171 , prop_state(svn_wc_notify_state_inapplicable)
171172 , rev(0)
172- , color(::GetSysColor(COLOR_WINDOWTEXT))
173+ , color(CTheme::Instance().GetThemeColor(::GetSysColor(COLOR_WINDOWTEXT), true))
173174 , bConflictedActionItem(false)
174175 , bTreeConflict(false)
175176 , bAuxItem(false)
@@ -249,6 +250,7 @@
249250 afx_msg void OnBnClickedRetryDifferentUser();
250251 afx_msg LRESULT OnCheck(WPARAM wnd, LPARAM);
251252 afx_msg LRESULT OnResolveMsg(WPARAM, LPARAM);
253+ afx_msg void OnSysColorChange();
252254
253255 DECLARE_MESSAGE_MAP()
254256
@@ -379,6 +381,7 @@
379381 int iFirstResized;
380382 BOOL bSecondResized;
381383 int nEnsureVisibleCount;
384+ UINT m_nBackgroundImageID;
382385
383386 CString m_sTotalBytesTransferred;
384387 CLinkControl m_jumpConflictControl;
--- trunk/src/TortoiseProc/stdafx.h (revision 28754)
+++ trunk/src/TortoiseProc/stdafx.h (revision 28755)
@@ -101,6 +101,7 @@
101101
102102 #define USE_GDI_GRADIENT
103103 #define HISTORYCOMBO_WITH_SYSIMAGELIST
104+#define REGSTRING_DARKTHEME L"Software\\TortoiseSVN\\DarkTheme"
104105
105106 #include "ProfilingInfo.h"
106107 #include "DebugOutput.h"
--- trunk/src/Utils/MiscUI/HyperLink.cpp (revision 28754)
+++ trunk/src/Utils/MiscUI/HyperLink.cpp (revision 28755)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2006, 2008, 2011-2012, 2014, 2018 - TortoiseSVN
3+// Copyright (C) 2003-2006, 2008, 2011-2012, 2014, 2018, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -22,23 +22,22 @@
2222 #include <atlconv.h>
2323
2424 #ifdef _DEBUG
25-#define new DEBUG_NEW
26-#undef THIS_FILE
25+# define new DEBUG_NEW
26+# undef THIS_FILE
2727 static char THIS_FILE[] = __FILE__;
2828 #endif
2929
3030 #define TOOLTIP_ID 1
3131
32-
3332 CHyperLink::CHyperLink()
3433 {
35- m_hLinkCursor = NULL; // No cursor as yet
36- m_crLinkColor = RGB( 0, 0, 238); // Blue
37- m_crHoverColor = RGB(255, 0, 0); // Red
38- m_bOverControl = FALSE; // Cursor not yet over control
39- m_nUnderline = ulHover; // Underline the link?
34+ m_hLinkCursor = NULL; // No cursor as yet
35+ m_crLinkColor = GetSysColor(COLOR_HOTLIGHT); // Blue
36+ m_crHoverColor = RGB(255, 0, 0); // Red
37+ m_bOverControl = FALSE; // Cursor not yet over control
38+ m_nUnderline = ulHover; // Underline the link?
4039 m_strURL.Empty();
41- m_nTimerID = 100;
40+ m_nTimerID = 100;
4241 }
4342
4443 CHyperLink::~CHyperLink()
@@ -46,7 +45,6 @@
4645 m_UnderlineFont.DeleteObject();
4746 }
4847
49-
5048 BOOL CHyperLink::DestroyWindow()
5149 {
5250 KillTimer(m_nTimerID);
@@ -60,7 +58,6 @@
6058 return CStatic::PreTranslateMessage(pMsg);
6159 }
6260
63-
6461 void CHyperLink::PreSubclassWindow()
6562 {
6663 // Enable notifications - CStatic has this disabled by default
@@ -78,22 +75,22 @@
7875 }
7976
8077 LOGFONT lf;
81- CFont* pFont = GetFont();
78+ CFont* pFont = GetFont();
8279 if (pFont)
8380 pFont->GetObject(sizeof(lf), &lf);
8481 else
8582 {
86- NONCLIENTMETRICS metrics = { 0 };
87- metrics.cbSize = sizeof(NONCLIENTMETRICS);
83+ NONCLIENTMETRICS metrics = {0};
84+ metrics.cbSize = sizeof(NONCLIENTMETRICS);
8885 SystemParametersInfo(SPI_GETNONCLIENTMETRICS, 0, &metrics, FALSE);
8986 memcpy_s(&lf, sizeof(LOGFONT), &metrics.lfMessageFont, sizeof(LOGFONT));
9087 }
9188
9289 m_StdFont.CreateFontIndirect(&lf);
93- lf.lfUnderline = (BYTE) TRUE;
90+ lf.lfUnderline = (BYTE)TRUE;
9491 m_UnderlineFont.CreateFontIndirect(&lf);
9592
96- SetDefaultCursor(); // try loading a "hand" cursor
93+ SetDefaultCursor(); // try loading a "hand" cursor
9794 SetUnderline();
9895
9996 CRect rect;
@@ -111,9 +108,9 @@
111108 ON_WM_TIMER()
112109 ON_WM_ERASEBKGND()
113110 ON_CONTROL_REFLECT(STN_CLICKED, OnClicked)
111+ ON_WM_SYSCOLORCHANGE()
114112 END_MESSAGE_MAP()
115113
116-
117114 void CHyperLink::OnClicked()
118115 {
119116 GotoURL(m_strURL);
@@ -160,7 +157,7 @@
160157
161158 if (m_nUnderline != ulAlways)
162159 SetFont(&m_StdFont);
163- rect.bottom+=10;
160+ rect.bottom += 10;
164161 InvalidateRect(rect);
165162 }
166163
@@ -203,7 +200,7 @@
203200
204201 void CHyperLink::SetColors(COLORREF crLinkColor, COLORREF crHoverColor)
205202 {
206- m_crLinkColor = crLinkColor;
203+ m_crLinkColor = crLinkColor;
207204
208205 if (crHoverColor == -1)
209206 m_crHoverColor = ::GetSysColor(COLOR_HIGHLIGHT);
@@ -255,7 +252,7 @@
255252 {
256253 // first try the windows hand cursor (not available on NT4)
257254 #ifndef OCR_HAND
258-# define OCR_HAND 32649
255+# define OCR_HAND 32649
259256 #endif
260257 HCURSOR hHandCursor = (HCURSOR)::LoadImage(NULL, MAKEINTRESOURCE(OCR_HAND), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE | LR_SHARED);
261258 if (hHandCursor)
@@ -265,13 +262,14 @@
265262 }
266263 // windows cursor not available, so try to load it from winhlp32.exe
267264 CString strWndDir;
268- GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH); // Explorer can't handle paths longer than MAX_PATH.
265+ GetWindowsDirectory(strWndDir.GetBuffer(MAX_PATH), MAX_PATH); // Explorer can't handle paths longer than MAX_PATH.
269266 strWndDir.ReleaseBuffer();
270267
271268 strWndDir += L"\\winhlp32.exe";
272269 // This retrieves cursor #106 from winhlp32.exe, which is a hand pointer
273270 CAutoLibrary hModule = LoadLibrary(strWndDir);
274- if (hModule) {
271+ if (hModule)
272+ {
275273 HCURSOR hHandCursor2 = (HCURSOR)::LoadImage(hModule, MAKEINTRESOURCE(106), IMAGE_CURSOR, 0, 0, LR_DEFAULTSIZE);
276274 if (hHandCursor2)
277275 m_hLinkCursor = CopyCursor(hHandCursor2);
@@ -281,6 +279,12 @@
281279
282280 HINSTANCE CHyperLink::GotoURL(LPCTSTR url)
283281 {
284- return ShellExecute(NULL, L"open", url, NULL,NULL, SW_SHOW);
282+ return ShellExecute(NULL, L"open", url, NULL, NULL, SW_SHOW);
285283 }
286284
285+void CHyperLink::OnSysColorChange()
286+{
287+ __super::OnSysColorChange();
288+ m_crLinkColor = GetSysColor(COLOR_HOTLIGHT);
289+ Invalidate();
290+}
--- trunk/src/Utils/MiscUI/HyperLink.h (revision 28754)
+++ trunk/src/Utils/MiscUI/HyperLink.h (revision 28755)
@@ -1,6 +1,6 @@
1-// TortoiseSVN - a Windows shell extension for easy version control
1+// TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2007, 2008 - TortoiseSVN
3+// Copyright (C) 2003-2007, 2008, 2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -76,5 +76,6 @@
7676 afx_msg void OnTimer(UINT_PTR nIDEvent);
7777 afx_msg BOOL OnEraseBkgnd(CDC* pDC);
7878 afx_msg void OnClicked();
79+ afx_msg void OnSysColorChange();
7980 DECLARE_MESSAGE_MAP()
8081 };
--- trunk/src/Utils/MiscUI/SciEdit.cpp (revision 28754)
+++ trunk/src/Utils/MiscUI/SciEdit.cpp (revision 28755)
@@ -27,6 +27,7 @@
2727 #include "SciEdit.h"
2828 #include "OnOutOfScope.h"
2929 #include "LoadIconEx.h"
30+#include "Theme.h"
3031
3132
3233 void CSciEditContextMenuInterface::InsertMenuItems(CMenu&, int&) {return;}
@@ -1041,8 +1042,17 @@
10411042 BEGIN_MESSAGE_MAP(CSciEdit, CWnd)
10421043 ON_WM_KEYDOWN()
10431044 ON_WM_CONTEXTMENU()
1045+ ON_WM_SYSCOLORCHANGE()
10441046 END_MESSAGE_MAP()
10451047
1048+void CSciEdit::OnSysColorChange()
1049+{
1050+ __super::OnSysColorChange();
1051+ Call(SCI_STYLESETFORE, STYLE_DEFAULT, ::GetSysColor(COLOR_WINDOWTEXT));
1052+ Call(SCI_STYLESETBACK, STYLE_DEFAULT, ::GetSysColor(COLOR_WINDOW));
1053+ Call(SCI_SETCARETFORE, ::GetSysColor(COLOR_WINDOWTEXT));
1054+}
1055+
10461056 void CSciEdit::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
10471057 {
10481058 switch (nChar)
--- trunk/src/Utils/MiscUI/SciEdit.h (revision 28754)
+++ trunk/src/Utils/MiscUI/SciEdit.h (revision 28755)
@@ -1,6 +1,6 @@
11 // TortoiseSVN - a Windows shell extension for easy version control
22
3-// Copyright (C) 2003-2011, 2013, 2015-2019 - TortoiseSVN
3+// Copyright (C) 2003-2011, 2013, 2015-2020 - TortoiseSVN
44
55 // This program is free software; you can redistribute it and/or
66 // modify it under the terms of the GNU General Public License
@@ -178,5 +178,6 @@
178178
179179 afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
180180 afx_msg void OnContextMenu(CWnd* /*pWnd*/, CPoint /*point*/);
181+ afx_msg void OnSysColorChange();
181182 DECLARE_MESSAGE_MAP()
182183 };
Show on old repository browser