diff options
author | George Hazan <ghazan@miranda.im> | 2023-01-02 16:53:03 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2023-01-02 16:53:03 +0300 |
commit | cf26766d814c01a99d8834693662ca590980f012 (patch) | |
tree | 0e5215cee21d89427d92fa74490bede33bfe7535 | |
parent | 16c56fd6e23135895b73082c11a5ae6a321cc9f9 (diff) |
fixes #3279 (PluginUpdate: popup color settings)
-rw-r--r-- | plugins/PluginUpdater/src/Options.cpp | 41 | ||||
-rw-r--r-- | 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 <stdver.h>
|