summaryrefslogtreecommitdiff
path: root/plugins/Scriver
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2016-12-08 18:04:28 +0300
committerGeorge Hazan <ghazan@miranda.im>2016-12-08 18:04:28 +0300
commit6cdf2af0e28710a64d917d981dc8f3fae1bade08 (patch)
tree1f5153b926ae5d83a1c34054d03a2c6809f2b4d7 /plugins/Scriver
parent6813bac6fee9b1ca6b80c700db30f54416782282 (diff)
Scriver: fix for a broken toolbar visibility control
Diffstat (limited to 'plugins/Scriver')
-rw-r--r--plugins/Scriver/src/chat/window.cpp8
-rw-r--r--plugins/Scriver/src/msgdialog.cpp5
-rw-r--r--plugins/Scriver/src/utils.cpp4
-rw-r--r--plugins/Scriver/src/utils.h2
4 files changed, 11 insertions, 8 deletions
diff --git a/plugins/Scriver/src/chat/window.cpp b/plugins/Scriver/src/chat/window.cpp
index b5cf1340f4..c7e8ce8c4a 100644
--- a/plugins/Scriver/src/chat/window.cpp
+++ b/plugins/Scriver/src/chat/window.cpp
@@ -81,10 +81,10 @@ static void InitButtons(HWND hwndDlg, SESSION_INFO *si)
static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h)
{
int logBottom, toolbarTopY;
- BOOL bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
- BOOL bToolbar = SendMessage(GetParent(hwndDlg), CM_GETTOOLBARSTATUS, 0, 0);
+ bool bNick = si->iType != GCW_SERVER && si->bNicklistEnabled;
+ bool bToolbar = SendMessage(GetParent(hwndDlg), CM_GETTOOLBARSTATUS, 0, 0) != 0;
int hSplitterMinTop = TOOLBAR_HEIGHT + si->minLogBoxHeight, hSplitterMinBottom = si->minEditBoxHeight;
- int toolbarHeight = TOOLBAR_HEIGHT;
+ int toolbarHeight = bToolbar ? TOOLBAR_HEIGHT : 0;
si->iSplitterY = si->desiredInputAreaHeight + SPLITTER_HEIGHT + 3;
@@ -125,7 +125,7 @@ static void MessageDialogResize(HWND hwndDlg, SESSION_INFO *si, int w, int h)
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_MESSAGE), 0, 1, h - si->iSplitterY + SPLITTER_HEIGHT, w - 2, si->iSplitterY - SPLITTER_HEIGHT - 1, SWP_NOZORDER);
EndDeferWindowPos(hdwp);
- SetButtonsPos(hwndDlg);
+ SetButtonsPos(hwndDlg, bToolbar);
if (si->hwndLog != NULL) {
IEVIEWWINDOW ieWindow;
diff --git a/plugins/Scriver/src/msgdialog.cpp b/plugins/Scriver/src/msgdialog.cpp
index b40546ee8a..8767b67984 100644
--- a/plugins/Scriver/src/msgdialog.cpp
+++ b/plugins/Scriver/src/msgdialog.cpp
@@ -445,7 +445,8 @@ static void SubclassLogEdit(HWND hwnd)
static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h)
{
ParentWindowData *pdat = dat->parent;
- int hSplitterPos = dat->splitterPos, toolbarHeight = dat->toolbarSize.cy;
+ bool bToolbar = (pdat->flags2 & SMF2_SHOWTOOLBAR) != 0;
+ int hSplitterPos = dat->splitterPos, toolbarHeight = (bToolbar) ? dat->toolbarSize.cy : 0;
int hSplitterMinTop = toolbarHeight + dat->minLogBoxHeight, hSplitterMinBottom = dat->minEditBoxHeight;
int infobarInnerHeight = INFO_BAR_INNER_HEIGHT;
int infobarHeight = INFO_BAR_HEIGHT;
@@ -510,7 +511,7 @@ static void MessageDialogResize(HWND hwndDlg, SrmmWindowData *dat, int w, int h)
hdwp = DeferWindowPos(hdwp, GetDlgItem(hwndDlg, IDC_SPLITTERY), 0, 0, h - hSplitterPos - 1, toolbarWidth, SPLITTER_HEIGHT, SWP_NOZORDER);
EndDeferWindowPos(hdwp);
- SetButtonsPos(hwndDlg);
+ SetButtonsPos(hwndDlg, bToolbar);
if (dat->hwndLog != NULL) {
IEVIEWWINDOW ieWindow = { sizeof(ieWindow) };
diff --git a/plugins/Scriver/src/utils.cpp b/plugins/Scriver/src/utils.cpp
index 70e6198234..949dcbd665 100644
--- a/plugins/Scriver/src/utils.cpp
+++ b/plugins/Scriver/src/utils.cpp
@@ -434,7 +434,7 @@ void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT *rect)
SendMessage(hwndTT, TTM_NEWTOOLRECT, 0, (LPARAM)&ti);
}
-void SetButtonsPos(HWND hwndDlg)
+void SetButtonsPos(HWND hwndDlg, bool bShow)
{
HDWP hdwp = BeginDeferWindowPos(Srmm_GetButtonCount());
@@ -454,6 +454,8 @@ void SetButtonsPos(HWND hwndDlg)
if (hwndButton == NULL)
continue;
+ ShowWindow(hwndButton, bShow ? SW_SHOW : SW_HIDE);
+
int width = iGap + cbd->m_iButtonWidth;
if (cbd->m_bRSided) {
iRightX -= width;
diff --git a/plugins/Scriver/src/utils.h b/plugins/Scriver/src/utils.h
index 66db731f03..ddc50a9b27 100644
--- a/plugins/Scriver/src/utils.h
+++ b/plugins/Scriver/src/utils.h
@@ -52,5 +52,5 @@ void GetContactUniqueId(SrmmWindowData *dat, char *buf, int maxlen);
HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle, RECT *rect);
void SetToolTipText(HWND hwndParent, HWND hwndTT, LPTSTR ptszText, LPTSTR ptszTitle);
void SetToolTipRect(HWND hwndParent, HWND hwndTT, RECT* rect);
-void SetButtonsPos(HWND hwndDlg);
+void SetButtonsPos(HWND hwndDlg, bool bShow);
#endif