From 5a55cb63fde0e53047bd785fca8ffb88d9102918 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Jan 2025 19:01:04 +0300 Subject: =?UTF-8?q?fixes=20#4841=20(Weather:=20=D0=BD=D0=B5=D0=BA=D0=BE?= =?UTF-8?q?=D1=80=D1=80=D0=B5=D0=BA=D1=82=D0=BD=D0=BE=20=D1=80=D0=B0=D0=B1?= =?UTF-8?q?=D0=BE=D1=82=D0=B0=D0=B5=D1=82=20=D0=BE=D0=BF=D1=86=D0=B8=D1=8F?= =?UTF-8?q?=20"=D0=A6=D0=B2=D0=B5=D1=82=D0=B0=20Windows"=20=D0=B2=20=D0=BD?= =?UTF-8?q?=D0=B0=D1=81=D1=82=D1=80=D0=BE=D0=B9=D0=BA=D0=B0=D1=85=20=D0=B2?= =?UTF-8?q?=D1=81=D0=BF=D0=BB.=20=D0=BE=D0=BA=D0=BE=D0=BD)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- protocols/Weather/src/weather_popup.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'protocols/Weather/src/weather_popup.cpp') diff --git a/protocols/Weather/src/weather_popup.cpp b/protocols/Weather/src/weather_popup.cpp index 567788c56e..5075f94410 100644 --- a/protocols/Weather/src/weather_popup.cpp +++ b/protocols/Weather/src/weather_popup.cpp @@ -232,7 +232,7 @@ class CPopupOptsDlg : public CWeatherDlgBase opt.pDelay = num; // other options - opt.UseWinColors = (uint8_t)IsDlgButtonChecked(hdlg, IDC_USEWINCOLORS); + opt.UseWinColors = chkUseWin.IsChecked(); opt.UpdatePopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP1); opt.AlertPopup = (uint8_t)IsDlgButtonChecked(hdlg, IDC_POP2); opt.PopupOnChange = (uint8_t)IsDlgButtonChecked(hdlg, IDC_CH); @@ -304,9 +304,7 @@ public: SendDlgItemMessage(m_hwnd, IDC_TEXTCOLOUR, CPM_SETCOLOUR, 0, opt.TextColour); // Second step is disabling them if we want to use default Windows ones. - CheckDlgButton(m_hwnd, IDC_USEWINCOLORS, opt.UseWinColors ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(m_hwnd, IDC_BGCOLOUR), !opt.UseWinColors); - EnableWindow(GetDlgItem(m_hwnd, IDC_TEXTCOLOUR), !opt.UseWinColors); + chkUseWin.SetState(opt.UseWinColors); // buttons SendDlgItemMessage(m_hwnd, IDC_PREVIEW, BUTTONSETASFLATBTN, TRUE, 0); @@ -335,11 +333,12 @@ public: return true; } - void onChanged_UseWin(CCtrlCheck *) + void onChanged_UseWin(CCtrlCheck *pCheck) { // use window color - enable/disable color selection controls - EnableWindow(GetDlgItem(m_hwnd, IDC_BGCOLOUR), !(m_proto->opt.UseWinColors)); - EnableWindow(GetDlgItem(m_hwnd, IDC_TEXTCOLOUR), !(m_proto->opt.UseWinColors)); + bool bEnable = !pCheck->IsChecked(); + EnableWindow(GetDlgItem(m_hwnd, IDC_BGCOLOUR), bEnable); + EnableWindow(GetDlgItem(m_hwnd, IDC_TEXTCOLOUR), bEnable); } void onClick_Right(CCtrlButton *) -- cgit v1.2.3