From cf26766d814c01a99d8834693662ca590980f012 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 2 Jan 2023 16:53:03 +0300 Subject: fixes #3279 (PluginUpdate: popup color settings) --- plugins/PluginUpdater/src/Options.cpp | 41 ++++++++++------------------------- plugins/PluginUpdater/src/version.h | 2 +- 2 files changed, 13 insertions(+), 30 deletions(-) diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index 5ca1a139bb..9fb7ecfa6c 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -355,7 +355,7 @@ static PopupActions[] = class CPopupOptDlg : public CDlgBase { - CCtrlCheck chOwnColors, chkWinColors, chkPopupColors, chkErrors, chkInfo; + CCtrlCheck chkOwnColors, chkWinColors, chkPopupColors, chkErrors, chkInfo; CCtrlButton btnPreview; public: @@ -364,7 +364,7 @@ public: btnPreview(this, IDC_PREVIEW), chkInfo(this, IDC_INFO_MESSAGES), chkErrors(this, IDC_ERRORS), - chOwnColors(this, IDC_USEOWNCOLORS), + chkOwnColors(this, IDC_USEOWNCOLORS), chkWinColors(this, IDC_USEWINCOLORS), chkPopupColors(this, IDC_USEPOPUPCOLORS) { @@ -373,18 +373,16 @@ public: chkInfo.OnChange = Callback(this, &CPopupOptDlg::onChange_Info); chkErrors.OnChange = Callback(this, &CPopupOptDlg::onChange_Errors); - chOwnColors.OnChange = Callback(this, &CPopupOptDlg::onChange_OwnColors); - chkWinColors.OnChange = Callback(this, &CPopupOptDlg::onChange_WinColors); - chkPopupColors.OnChange = Callback(this, &CPopupOptDlg::onChange_PopupColors); + chkOwnColors.OnChange = chkWinColors.OnChange = chkPopupColors.OnChange = Callback(this, &CPopupOptDlg::onChange_Colors); } bool OnInitDialog() override { //Colors if (g_plugin.PopupDefColors == byCOLOR_OWN) - chkWinColors.SetState(true); + chkOwnColors.SetState(true); else if (g_plugin.PopupDefColors == byCOLOR_WINDOWS) - chOwnColors.SetState(true); + chkWinColors.SetState(true); else if (g_plugin.PopupDefColors == byCOLOR_POPUP) chkPopupColors.SetState(true); @@ -438,7 +436,7 @@ public: if (chkWinColors.GetState()) g_plugin.PopupDefColors = byCOLOR_WINDOWS; - else if (chOwnColors.GetState()) + else if (chkOwnColors.GetState()) g_plugin.PopupDefColors = byCOLOR_OWN; else g_plugin.PopupDefColors = byCOLOR_POPUP; @@ -474,32 +472,17 @@ public: return CDlgBase::DlgProc(msg, wParam, lParam); } - void onChange_OwnColors(CCtrlCheck *) + void onChange_Colors(CCtrlCheck *pCheck) { - for (auto &it : PopupsList) { - EnableWindow(GetDlgItem(m_hwnd, it.ctrl2), TRUE); //Text - EnableWindow(GetDlgItem(m_hwnd, it.ctrl3), TRUE); //Background - } - } + if (!m_bInitialized) return; - void onChange_WinColors(CCtrlCheck *) - { - // Use Windows colors + bool bEnable = (pCheck == &chkOwnColors); for (auto &it : PopupsList) { - EnableWindow(GetDlgItem(m_hwnd, it.ctrl2), FALSE); //Text - EnableWindow(GetDlgItem(m_hwnd, it.ctrl3), FALSE); //Background + EnableWindow(GetDlgItem(m_hwnd, it.ctrl2), bEnable); //Text + EnableWindow(GetDlgItem(m_hwnd, it.ctrl3), bEnable); //Background } } - - void onChange_PopupColors(CCtrlCheck *) - { - // Use Popup colors - for (auto &it : PopupsList) { - EnableWindow(GetDlgItem(m_hwnd, it.ctrl2), FALSE); //Text - EnableWindow(GetDlgItem(m_hwnd, it.ctrl3), FALSE); //Background - } - } - + void onClick_Preview(CCtrlButton *) { LPCTSTR Title = TranslateT("Plugin Updater"); diff --git a/plugins/PluginUpdater/src/version.h b/plugins/PluginUpdater/src/version.h index cb7b340418..3697cde49a 100644 --- a/plugins/PluginUpdater/src/version.h +++ b/plugins/PluginUpdater/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 0 #define __MINOR_VERSION 2 #define __RELEASE_NUM 1 -#define __BUILD_NUM 3 +#define __BUILD_NUM 4 #include -- cgit v1.2.3