summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2018-05-09 14:04:32 +0200
committerGeorge Hazan <ghazan@miranda.im>2018-05-09 14:04:32 +0200
commite0082769561896ea56327fbba5499b13b8043861 (patch)
tree6d4d2ea2a68046bbeb6c4cb357d6e8f03b477884 /src
parent084482bf3a03478fc1678e72f01553fad22662f9 (diff)
fixes #1340 (StdMsg: first button on buttons toolbar is bugged in some cases)
Diffstat (limited to 'src')
-rw-r--r--src/core/stdmsg/src/msgdialog.cpp4
-rw-r--r--src/core/stdmsg/src/msgs.cpp21
2 files changed, 9 insertions, 16 deletions
diff --git a/src/core/stdmsg/src/msgdialog.cpp b/src/core/stdmsg/src/msgdialog.cpp
index 02278c8e9f..df810752a3 100644
--- a/src/core/stdmsg/src/msgdialog.cpp
+++ b/src/core/stdmsg/src/msgdialog.cpp
@@ -353,12 +353,12 @@ void CSrmmWindow::OnOptionsApplied(bool bUpdateAvatar)
continue;
bool bShow = false;
- if (m_hContact) {
+ if (m_hContact && g_dat.bShowButtons) {
if (cbd->m_dwButtonCID == IDC_ADD) {
bShow = 0 != db_get_b(m_hContact, "CList", "NotOnList", 0);
cbd->m_bHidden = !bShow;
}
- else bShow = g_dat.bShowButtons;
+ else bShow = true;
}
ShowWindow(hwndButton, (bShow) ? SW_SHOW : SW_HIDE);
}
diff --git a/src/core/stdmsg/src/msgs.cpp b/src/core/stdmsg/src/msgs.cpp
index 1b8a5f9727..eac78a6b84 100644
--- a/src/core/stdmsg/src/msgs.cpp
+++ b/src/core/stdmsg/src/msgs.cpp
@@ -409,27 +409,20 @@ 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 (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;
- }
+ 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);