From d17d767231d8ea9cdcff0ee888edb729eb064f11 Mon Sep 17 00:00:00 2001 From: lededev <30518126+lededev@users.noreply.github.com> Date: Mon, 11 Nov 2024 19:50:22 +0800 Subject: [PATCH] Add a "Defaults" button to the "Options (Colors/System)" dialog. (#2506) --- Src/Merge.rc | 7 ++++++- Src/PropSysColors.cpp | 8 ++++++++ Src/PropSysColors.h | 1 + 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Src/Merge.rc b/Src/Merge.rc index 90b0e360724..d31125f4ec0 100644 --- a/Src/Merge.rc +++ b/Src/Merge.rc @@ -1781,6 +1781,7 @@ BEGIN "Button",BS_AUTOCHECKBOX | WS_TABSTOP,6,12,264,10 COMBOBOX IDC_SYSCOLOR_NAME,6,30,144,93,CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP CONTROL "",IDC_SYSCOLOR,"Button",BS_OWNERDRAW,162,30,17,14,WS_EX_TRANSPARENT | WS_EX_CLIENTEDGE + PUSHBUTTON "Defaults",IDC_COMPARE_DEFAULTS,191,228,88,14 END IDD_PROPPAGE_SYSTEM DIALOGEX 0, 0, 285, 242 @@ -3358,7 +3359,11 @@ END IDD_PROPPAGE_COLORS_SYSTEM AFX_DIALOG_LAYOUT BEGIN - 0 + 0, + 0, 0, 100, 0, + 0, 0, 100, 0, + 100, 0, 0, 0, + 100, 0, 0, 0 END diff --git a/Src/PropSysColors.cpp b/Src/PropSysColors.cpp index f50f7063c92..dc75f19a039 100644 --- a/Src/PropSysColors.cpp +++ b/Src/PropSysColors.cpp @@ -43,6 +43,7 @@ BEGIN_MESSAGE_MAP(PropSysColors, OptionsPanel) ON_BN_CLICKED(IDC_SYSCOLOR_HOOK_ENABLED, OnBnClickedSysColorHookEnabled) ON_CBN_SELCHANGE(IDC_SYSCOLOR_NAME, OnCbnSelchangeSysColorName) ON_BN_CLICKED(IDC_SYSCOLOR, OnBnClickedSysColor) + ON_BN_CLICKED(IDC_COMPARE_DEFAULTS, OnDefaults) //}}AFX_MSG_MAP END_MESSAGE_MAP() @@ -164,3 +165,10 @@ void PropSysColors::OnBnClickedSysColor() { BrowseColor(m_btnSysColor); } + +void PropSysColors::OnDefaults() +{ + for (int i = 0; i < static_cast(m_cSysColors.size()); i++) + m_cSysColors[i] = SysColorHook::GetOrgSysColor(i); + UpdateControls(); +} diff --git a/Src/PropSysColors.h b/Src/PropSysColors.h index c325e3c49e2..b37c22e6e72 100644 --- a/Src/PropSysColors.h +++ b/Src/PropSysColors.h @@ -56,6 +56,7 @@ class PropSysColors : public OptionsPanel afx_msg void OnBnClickedSysColorHookEnabled(); afx_msg void OnCbnSelchangeSysColorName(); afx_msg void OnBnClickedSysColor(); + afx_msg void OnDefaults(); //}}AFX_MSG DECLARE_MESSAGE_MAP() };