summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-05 13:02:32 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-05 13:02:32 +0300
commit741732d2578caebd40446e221f5ee7f44330e907 (patch)
tree8357aa9919e3e75d32e33ccc16b4b590d52d60cc
parentbf52c6896700d435d9623d27d74e595c504dff08 (diff)
fixes #3701 (tabSRMM: в редакторе кнопок криво отображаются многострочные описания)
-rw-r--r--include/m_srmm_int.h3
-rw-r--r--src/mir_app/src/srmm_toolbar.cpp12
2 files changed, 13 insertions, 2 deletions
diff --git a/include/m_srmm_int.h b/include/m_srmm_int.h
index ab50d3ee6f..5e11a4b95a 100644
--- a/include/m_srmm_int.h
+++ b/include/m_srmm_int.h
@@ -53,11 +53,12 @@ struct CustomButtonData : public MZeroedObject
int m_dwButtonID; // id of button used while button creation and to store button info in DB
ptrA m_pszModuleName; // module name without spaces and underline symbols (e.g. "tabsrmm")
- int m_dwButtonCID; // button's control id
+ int m_dwButtonCID; // button's control id
int m_dwArrowCID; // only use with BBBF_ISARROWBUTTON flag
ptrW m_pwszText; // button's text
ptrW m_pwszTooltip; // button's tooltip
+ ptrW m_pwszOptions; // button's name in options, might be NULL
int m_iButtonWidth; // must be 22 for regular button and 33 for button with arrow
HANDLE m_hIcon; // Handle to icolib registred icon
diff --git a/src/mir_app/src/srmm_toolbar.cpp b/src/mir_app/src/srmm_toolbar.cpp
index 45450eaa26..72f64a935f 100644
--- a/src/mir_app/src/srmm_toolbar.cpp
+++ b/src/mir_app/src/srmm_toolbar.cpp
@@ -495,7 +495,10 @@ class CSrmmToolbarOptions : public CDlgBase
tvis.item.iImage = tvis.item.iSelectedImage = 0;
}
else {
- tvis.item.pszText = TranslateW(cbd->m_pwszTooltip);
+ if (cbd->m_pwszOptions)
+ tvis.item.pszText = TranslateW(cbd->m_pwszOptions);
+ else
+ tvis.item.pszText = TranslateW(cbd->m_pwszTooltip);
tvis.item.iImage = tvis.item.iSelectedImage = ImageList_AddIcon(m_hImgl, IcoLib_GetIconByHandle(cbd->m_hIcon));
}
cbd->m_opFlags = 0;
@@ -724,6 +727,13 @@ MIR_APP_DLL(HANDLE) Srmm_AddButton(const BBButton *bbdi, HPLUGIN _hLang)
cbd->m_pwszText = mir_wstrdup(bbdi->pwszText);
cbd->m_pwszTooltip = mir_wstrdup(bbdi->pwszTooltip);
+ CMStringW wszText(cbd->m_pwszTooltip);
+ int idx = wszText.Find('\n');
+ if (idx != -1) {
+ wszText.Truncate(idx);
+ cbd->m_pwszOptions = wszText.Detach();
+ }
+
cbd->m_dwButtonID = bbdi->dwButtonID;
cbd->m_hIcon = bbdi->hIcon;
cbd->m_dwPosition = cbd->m_dwOrigPosition = bbdi->dwDefPos;