diff options
author | George Hazan <george.hazan@gmail.com> | 2014-01-15 12:42:41 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2014-01-15 12:42:41 +0000 |
commit | 0bc5a39c53b1422b980f210c1d418fcfde5b14ad (patch) | |
tree | 3da201ad4e87898962568d8a5479d8c7566f435c /src | |
parent | e11ecaaf2df6c1e50429f5a43f2346795cfce721 (diff) |
fixes for chat window resizer
git-svn-id: http://svn.miranda-ng.org/main/trunk@7664 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'src')
-rw-r--r-- | src/core/stdchat/src/window.cpp | 49 | ||||
-rw-r--r-- | src/modules/chat/manager.cpp | 5 |
2 files changed, 25 insertions, 29 deletions
diff --git a/src/core/stdchat/src/window.cpp b/src/core/stdchat/src/window.cpp index 632c3ed8d3..cfa7f713b2 100644 --- a/src/core/stdchat/src/window.cpp +++ b/src/core/stdchat/src/window.cpp @@ -177,40 +177,37 @@ static int RoomWndResize(HWND hwndDlg,LPARAM lParam,UTILRESIZECONTROL *urc) urc->rcItem.left = 0;
urc->rcItem.right = urc->dlgNewSize.cx- 24;
urc->rcItem.bottom = urc->dlgNewSize.cy - si->iSplitterY;
- if (bToolbar)
+ if (!bToolbar)
urc->rcItem.bottom += 20;
return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
case IDC_LOG:
urc->rcItem.top = bTabs?(bTabBottom?0:rcTabs.top-1):0;
urc->rcItem.left = 0;
- urc->rcItem.right = bNick?urc->dlgNewSize.cx - si->iSplitterX:urc->dlgNewSize.cx;
- urc->rcItem.bottom = (bTabs && bTabBottom) ? urc->dlgNewSize.cy - si->iSplitterY - TabHeight + 6 : urc->dlgNewSize.cy - si->iSplitterY;
- if (bToolbar)
- urc->rcItem.bottom += 20;
+ urc->rcItem.right = bNick ? urc->dlgNewSize.cx - si->iSplitterX : urc->dlgNewSize.cx;
+LBL_CalcBottom:
+ urc->rcItem.bottom = urc->dlgNewSize.cy - si->iSplitterY;
+ if (bTabs && bTabBottom) urc->rcItem.bottom += 6 - TabHeight;
+ if (!bToolbar) urc->rcItem.bottom += 20;
return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
case IDC_LIST:
urc->rcItem.top = bTabs?(bTabBottom?0:rcTabs.top-1):0;
urc->rcItem.right = urc->dlgNewSize.cx ;
urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX + 2;
- urc->rcItem.bottom = (bTabs && bTabBottom) ? urc->dlgNewSize.cy - si->iSplitterY - TabHeight + 6 : urc->dlgNewSize.cy - si->iSplitterY;
- if (bToolbar)
- urc->rcItem.bottom += 20;
- return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
+ goto LBL_CalcBottom;
case IDC_SPLITTERX:
- urc->rcItem.right = urc->dlgNewSize.cx - si->iSplitterX + 2;
- urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX;
- urc->rcItem.bottom = (bTabs && bTabBottom) ? urc->dlgNewSize.cy - si->iSplitterY - TabHeight + 6 : urc->dlgNewSize.cy - si->iSplitterY;
- if (bToolbar)
- urc->rcItem.bottom += 20;
urc->rcItem.top = bTabs ? rcTabs.top : 1;
- return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
+ urc->rcItem.left = urc->dlgNewSize.cx - si->iSplitterX;
+ urc->rcItem.right = urc->rcItem.left + 2;
+ goto LBL_CalcBottom;
case IDC_SPLITTERY:
- urc->rcItem.top = bToolbar ? urc->dlgNewSize.cy - si->iSplitterY : urc->dlgNewSize.cy - si->iSplitterY + 20;
- urc->rcItem.bottom = bToolbar ? (urc->dlgNewSize.cy - si->iSplitterY + 2) : (urc->dlgNewSize.cy - si->iSplitterY + 22);
+ urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY;
+ if (!bToolbar)
+ urc->rcItem.top += 20;
+ urc->rcItem.bottom = urc->rcItem.top + 2;
return RD_ANCHORX_WIDTH | RD_ANCHORY_CUSTOM;
case IDC_MESSAGE:
@@ -227,25 +224,25 @@ static int RoomWndResize(HWND hwndDlg,LPARAM lParam,UTILRESIZECONTROL *urc) case IDC_COLOR:
case IDC_BKGCOLOR:
urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY+3;
- urc->rcItem.bottom = urc->dlgNewSize.cy - si->iSplitterY+19;
- return RD_ANCHORX_LEFT|RD_ANCHORY_CUSTOM;
+ urc->rcItem.bottom = urc->rcItem.top + 16;
+ return RD_ANCHORX_LEFT | RD_ANCHORY_CUSTOM;
case IDC_HISTORY:
case IDC_CHANMGR:
case IDC_SHOWNICKLIST:
case IDC_FILTER:
urc->rcItem.top = urc->dlgNewSize.cy - si->iSplitterY+3;
- urc->rcItem.bottom = urc->dlgNewSize.cy - si->iSplitterY+19;
- return RD_ANCHORX_RIGHT|RD_ANCHORY_CUSTOM;
+ urc->rcItem.bottom = urc->rcItem.top + 16;
+ return RD_ANCHORX_RIGHT | RD_ANCHORY_CUSTOM;
case IDC_CLOSE:
- urc->rcItem.right = urc->dlgNewSize.cx-3;
urc->rcItem.left = urc->dlgNewSize.cx - 19;
- urc->rcItem.bottom = bTabBottom?(bToolbar?urc->dlgNewSize.cy - si->iSplitterY-2:urc->dlgNewSize.cy - si->iSplitterY-2+20):19;
- urc->rcItem.top = bTabBottom?(bToolbar?urc->dlgNewSize.cy - si->iSplitterY-18:urc->dlgNewSize.cy - si->iSplitterY-18+20):3;
- return RD_ANCHORX_CUSTOM|RD_ANCHORY_CUSTOM;
+ urc->rcItem.right = urc->rcItem.left + 16;
+ urc->rcItem.top = bTabBottom ? (bToolbar ? urc->dlgNewSize.cy - si->iSplitterY - 18 : urc->dlgNewSize.cy - si->iSplitterY - 18 + 20) : 3;
+ urc->rcItem.bottom = urc->rcItem.top + 16;
+ return RD_ANCHORX_CUSTOM | RD_ANCHORY_CUSTOM;
}
- return RD_ANCHORX_LEFT|RD_ANCHORY_TOP;
+ return RD_ANCHORX_LEFT | RD_ANCHORY_TOP;
}
static LRESULT CALLBACK MessageSubclassProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
diff --git a/src/modules/chat/manager.cpp b/src/modules/chat/manager.cpp index 40d673bf17..4b2194df98 100644 --- a/src/modules/chat/manager.cpp +++ b/src/modules/chat/manager.cpp @@ -90,8 +90,8 @@ static void SM_FreeSession(SESSION_INFO *si) // contact so the handle may be invalid, therefore db_get_b shall return 0
if (si->hContact && db_get_b(si->hContact, si->pszModule, "ChatRoom", 0) != 0) {
ci.SetOffline(si->hContact, si->iType == GCW_CHATROOM ? TRUE : FALSE);
- db_set_s(si->hContact, m_WndList->pszModule, "Topic", "");
- db_set_s(si->hContact, m_WndList->pszModule, "StatusBar", "");
+ db_set_s(si->hContact, si->pszModule, "Topic", "");
+ db_set_s(si->hContact, si->pszModule, "StatusBar", "");
db_unset(si->hContact, "CList", "StatusMsg");
}
@@ -902,7 +902,6 @@ static void MM_IconsChanged(void) ImageList_ReplaceIcon(ci.hIconsList, pTemp->OfflineIconIndex + 1, pTemp->hOfflineTalkIcon);
pTemp = pTemp->next;
}
- return;
}
static void MM_FontsChanged(void)
|