diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-08 19:15:08 +0200 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-08 19:15:08 +0200 |
commit | 9bdae200e50f5974977d4d0ba11c5e05b9733fe4 (patch) | |
tree | dddf8a8d1ed3d0cc8a186d8219300e2613706755 | |
parent | 5ddce2b1320316122a6165dc412cb83a98936df7 (diff) |
fixes #1332 (Artifact when "Show toolbar buttons on top wor" is disabled and you open private from conference room)
-rw-r--r-- | src/core/stdmsg/src/msgdialog.cpp | 2 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgoptions.cpp | 4 | ||||
-rw-r--r-- | src/core/stdmsg/src/msgs.cpp | 21 |
3 files changed, 17 insertions, 10 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp index 386552ee78..2456c527bf 100644 --- a/src/core/stdmsg/src/msgdialog.cpp +++ b/src/core/stdmsg/src/msgdialog.cpp @@ -659,7 +659,7 @@ int CSrmmWindow::Resizer(UTILRESIZECONTROL *urc) switch (urc->wId) {
case IDC_SRMM_LOG:
if (!g_dat.bShowButtons)
- urc->rcItem.top = 22;
+ urc->rcItem.top = 2;
urc->rcItem.bottom = urc->dlgNewSize.cy - m_iSplitterY;
return RD_ANCHORX_WIDTH | RD_ANCHORY_TOP;
diff --git a/src/core/stdmsg/src/msgoptions.cpp b/src/core/stdmsg/src/msgoptions.cpp index c729d2327f..59fc8bfd72 100644 --- a/src/core/stdmsg/src/msgoptions.cpp +++ b/src/core/stdmsg/src/msgoptions.cpp @@ -95,14 +95,14 @@ bool LoadMsgDlgFont(int i, LOGFONT* lf, COLORREF * colour) void RegisterSRMMFonts(void)
{
- char idstr[10];
-
FontIDW fontid = { sizeof(fontid) };
fontid.flags = FIDF_ALLOWREREGISTER | FIDF_DEFAULTVALID;
for (int i = 0; i < _countof(fontOptionsList); i++) {
strncpy_s(fontid.dbSettingsGroup, SRMMMOD, _TRUNCATE);
wcsncpy_s(fontid.group, LPGENW("Message Sessions") L"/" LPGENW("Message log"), _TRUNCATE);
wcsncpy_s(fontid.name, fontOptionsList[i].szDescr, _TRUNCATE);
+
+ char idstr[10];
mir_snprintf(idstr, "SRMFont%d", i);
strncpy_s(fontid.prefix, idstr, _TRUNCATE);
fontid.order = i;
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp index eac78a6b84..1b8a5f9727 100644 --- a/src/core/stdmsg/src/msgs.cpp +++ b/src/core/stdmsg/src/msgs.cpp @@ -409,20 +409,27 @@ void SetButtonsPos(HWND hwndDlg, bool bIsChat) GetClientRect(hwndDlg, &rc);
int iLeftX = 2, iRightX = rc.right - 2;
+ bool bShow = (bIsChat) ? true : g_dat.bShowButtons;
+
CustomButtonData *cbd;
for (int i = 0; cbd = Srmm_GetNthButton(i); i++) {
HWND hwndButton = GetDlgItem(hwndDlg, cbd->m_dwButtonCID);
if (hwndButton == nullptr || cbd->m_bHidden)
continue;
- if (cbd->m_bRSided) {
- iRightX -= g_dat.iGap + cbd->m_iButtonWidth;
- hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iRightX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- }
- else {
- hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iLeftX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
- iLeftX += g_dat.iGap + cbd->m_iButtonWidth;
+ if (bShow) {
+ ShowWindow(hwndButton, SW_SHOW);
+
+ if (cbd->m_bRSided) {
+ iRightX -= g_dat.iGap + cbd->m_iButtonWidth;
+ hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iRightX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ }
+ else {
+ hdwp = DeferWindowPos(hdwp, hwndButton, nullptr, iLeftX, yPos, 0, 0, SWP_NOZORDER | SWP_NOSIZE);
+ iLeftX += g_dat.iGap + cbd->m_iButtonWidth;
+ }
}
+ else ShowWindow(hwndButton, SW_HIDE);
}
EndDeferWindowPos(hdwp);
|