From 8f00b03d2fb4bd673c34747674ddebefa6cd0eaf Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 9 Nov 2024 17:11:38 +0300 Subject: fixes #4781 (tabSRMM: Clear formatting hotkey doesn't work) --- src/mir_app/src/srmm_toolbar.cpp | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp index bddeef51d4..0cf41733ea 100644 --- a/src/mir_app/src/srmm_toolbar.cpp +++ b/src/mir_app/src/srmm_toolbar.cpp @@ -221,16 +221,23 @@ MIR_APP_DLL(void) Srmm_ClickToolbarIcon(MCONTACT hContact, int idFrom, HWND hwnd ///////////////////////////////////////////////////////////////////////////////////////// +static void disablePush(CCtrlButton &btn) +{ + if (btn.IsPushed()) { + btn.Push(false); + btn.Click(); + } +} + void CSrmmBaseDialog::ProcessToolbarHotkey(INT_PTR iButtonFrom) { switch (iButtonFrom) { case SRMM_HK_CLEAR: - m_btnBold.Push(false); m_btnBold.Click(); - m_btnItalic.Push(false); m_btnItalic.Click(); - m_btnUnderline.Push(false); m_btnUnderline.Click(); - - m_btnColor.Push(false); m_btnColor.Click(); - m_btnBkColor.Push(false); m_btnBkColor.Click(); + disablePush(m_btnBold); + disablePush(m_btnItalic); + disablePush(m_btnUnderline); + disablePush(m_btnColor); + disablePush(m_btnBkColor); break; case SRMM_HK_BOLD: -- cgit v1.2.3