From 9bdae200e50f5974977d4d0ba11c5e05b9733fe4 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 8 May 2018 19:15:08 +0200 Subject: fixes #1332 (Artifact when "Show toolbar buttons on top wor" is disabled and you open private from conference room) --- src/core/stdmsg/src/msgdialog.cpp | 2 +- src/core/stdmsg/src/msgoptions.cpp | 4 ++-- 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); -- cgit v1.2.3