Skip to content

Commit

Permalink
Add a "Defaults" button to the "Options (Colors/System)" dialog. (#2506)
Browse files Browse the repository at this point in the history
  • Loading branch information
lededev authored Nov 11, 2024
1 parent 1d7aa13 commit d17d767
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Src/Merge.rc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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


Expand Down
8 changes: 8 additions & 0 deletions Src/PropSysColors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down Expand Up @@ -164,3 +165,10 @@ void PropSysColors::OnBnClickedSysColor()
{
BrowseColor(m_btnSysColor);
}

void PropSysColors::OnDefaults()
{
for (int i = 0; i < static_cast<int>(m_cSysColors.size()); i++)
m_cSysColors[i] = SysColorHook::GetOrgSysColor(i);
UpdateControls();
}
1 change: 1 addition & 0 deletions Src/PropSysColors.h
Original file line number Diff line number Diff line change
Expand Up @@ -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()
};

0 comments on commit d17d767

Please sign in to comment.