From 1dc3cf591258453a282785335fa8107663d4811b Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 24 Oct 2024 18:07:19 +0300 Subject: =?UTF-8?q?fixes=20#4758=20(StdMsg/Scriver:=20=D0=B4=D0=BE=D0=B1?= =?UTF-8?q?=D0=B0=D0=B2=D0=B8=D1=82=D1=8C=20=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA?= =?UTF-8?q?=D1=83=20"=D0=B7=D0=B0=D1=87=D0=B5=D1=80=D0=BA=D0=BD=D1=83?= =?UTF-8?q?=D1=82=D1=8B=D0=B9=20=D1=82=D0=B5=D0=BA=D1=81=D1=82")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/core/stdmsg/res/resource.rc | 2 ++ src/core/stdmsg/res/strike.ico | Bin 0 -> 1150 bytes src/core/stdmsg/src/chat_options.cpp | 1 + src/core/stdmsg/src/msgs.cpp | 11 +++++++++-- src/core/stdmsg/src/resource.h | 1 + src/mir_app/src/srmm_base.cpp | 7 +++++-- 6 files changed, 18 insertions(+), 4 deletions(-) create mode 100644 src/core/stdmsg/res/strike.ico (limited to 'src') diff --git a/src/core/stdmsg/res/resource.rc b/src/core/stdmsg/res/resource.rc index 33682f7e14..e5f80a1d86 100644 --- a/src/core/stdmsg/res/resource.rc +++ b/src/core/stdmsg/res/resource.rc @@ -357,6 +357,8 @@ IDI_BBOLD ICON "bold.ico" IDI_BITALICS ICON "italics.ico" +IDI_STRIKEOUT ICON "strike.ico" + IDI_BSMILEY ICON "smiley.ico" IDI_JOIN ICON "join.ico" diff --git a/src/core/stdmsg/res/strike.ico b/src/core/stdmsg/res/strike.ico new file mode 100644 index 0000000000..6cd770f384 Binary files /dev/null and b/src/core/stdmsg/res/strike.ico differ diff --git a/src/core/stdmsg/src/chat_options.cpp b/src/core/stdmsg/src/chat_options.cpp index 9755a3218c..836498c2fb 100644 --- a/src/core/stdmsg/src/chat_options.cpp +++ b/src/core/stdmsg/src/chat_options.cpp @@ -31,6 +31,7 @@ static IconItem iconList1[] = { LPGEN("Bold"), "bold", IDI_BBOLD }, { LPGEN("Italics"), "italics", IDI_BITALICS }, { LPGEN("Underlined"), "underline", IDI_BUNDERLINE }, + { LPGEN("Strike through"), "strikeout", IDI_STRIKEOUT }, { LPGEN("Smiley button"), "smiley", IDI_BSMILEY }, { LPGEN("Room history"), "history", IDI_HISTORY }, { LPGEN("Room settings"), "settings", IDI_TOPICBUT }, diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index b4583d9020..63a4da05b4 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -377,15 +377,22 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Make the text underlined (Ctrl+U)"); g_plugin.addButton(&bbd); - bbd.dwButtonID = IDC_SRMM_COLOR; + bbd.dwButtonID = IDC_SRMM_STRIKEOUT; bbd.dwDefPos = 25; + bbd.hIcon = g_plugin.getIconHandle(IDI_STRIKEOUT); + bbd.pwszText = LPGENW("&Strike-through "); + bbd.pwszTooltip = LPGENW("Make the text strike-through"); + g_plugin.addButton(&bbd); + + bbd.dwButtonID = IDC_SRMM_COLOR; + bbd.dwDefPos = 30; bbd.hIcon = g_plugin.getIconHandle(IDI_COLOR); bbd.pwszText = LPGENW("&Color"); bbd.pwszTooltip = LPGENW("Select a foreground color for the text (Ctrl+K)"); g_plugin.addButton(&bbd); bbd.dwButtonID = IDC_SRMM_BKGCOLOR; - bbd.dwDefPos = 30; + bbd.dwDefPos = 35; bbd.hIcon = g_plugin.getIconHandle(IDI_BKGCOLOR); bbd.pwszText = LPGENW("&Background color"); bbd.pwszTooltip = LPGENW("Select a background color for the text (Ctrl+L)"); diff --git a/src/core/stdmsg/src/resource.h b/src/core/stdmsg/src/resource.h index 8e5b4ea0d7..f5de2ae35b 100644 --- a/src/core/stdmsg/src/resource.h +++ b/src/core/stdmsg/src/resource.h @@ -10,6 +10,7 @@ #define IDD_CONTAINER 107 #define IDD_OPT_TABS 108 #define IDD_OPT_MSGHIST 109 +#define IDI_STRIKEOUT 110 #define IDI_BUNDERLINE 120 #define IDI_BBOLD 121 #define IDI_BITALICS 122 diff --git a/src/mir_app/src/srmm_base.cpp b/src/mir_app/src/srmm_base.cpp index aa286bd762..4c6d621b80 100644 --- a/src/mir_app/src/srmm_base.cpp +++ b/src/mir_app/src/srmm_base.cpp @@ -48,6 +48,7 @@ CSrmmBaseDialog::CSrmmBaseDialog(CMPluginBase &pPlugin, int idDialog, MCONTACT h m_btnItalic(this, IDC_SRMM_ITALICS), m_btnUnderline(this, IDC_SRMM_UNDERLINE), + m_btnStrikeout(this, IDC_SRMM_STRIKEOUT), m_Quote(this, IDC_SRMM_QUOTE), m_btnCloseQuote(this, IDC_SRMM_CLOSEQUOTE, SKINICON_OTHER_DELETE, LPGEN("Remove quoting")), @@ -58,7 +59,7 @@ CSrmmBaseDialog::CSrmmBaseDialog(CMPluginBase &pPlugin, int idDialog, MCONTACT h { m_btnColor.OnClick = Callback(this, &CSrmmBaseDialog::onClick_Color); m_btnBkColor.OnClick = Callback(this, &CSrmmBaseDialog::onClick_BkColor); - m_btnBold.OnClick = m_btnItalic.OnClick = m_btnUnderline.OnClick = Callback(this, &CSrmmBaseDialog::onClick_BIU); + m_btnBold.OnClick = m_btnItalic.OnClick = m_btnUnderline.OnClick = m_btnStrikeout.OnClick = Callback(this, &CSrmmBaseDialog::onClick_BIU); m_btnHistory.OnClick = Callback(this, &CSrmmBaseDialog::onClick_History); m_btnChannelMgr.OnClick = Callback(this, &CSrmmBaseDialog::onClick_ChanMgr); @@ -960,7 +961,7 @@ void CSrmmBaseDialog::onClick_BIU(CCtrlButton *pButton) CHARFORMAT2 cf; cf.cbSize = sizeof(CHARFORMAT2); - cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE; + cf.dwMask = CFM_BOLD | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT; cf.dwEffects = 0; if (IsDlgButtonChecked(m_hwnd, IDC_SRMM_BOLD)) @@ -969,6 +970,8 @@ void CSrmmBaseDialog::onClick_BIU(CCtrlButton *pButton) cf.dwEffects |= CFE_ITALIC; if (IsDlgButtonChecked(m_hwnd, IDC_SRMM_UNDERLINE)) cf.dwEffects |= CFE_UNDERLINE; + if (IsDlgButtonChecked(m_hwnd, IDC_SRMM_STRIKEOUT)) + cf.dwEffects |= CFM_STRIKEOUT; m_message.SendMsg(EM_SETCHARFORMAT, SCF_SELECTION, (LPARAM)&cf); } -- cgit v1.2.3