Feat: draggable splitter bar to resize host list and message log proportions

This commit is contained in:
yuanyuanxiang
2026-06-11 22:13:48 +02:00
parent 773f5d5973
commit 8c64886512
3 changed files with 123 additions and 5 deletions

View File

@@ -118,6 +118,20 @@ struct PendingTransferV2 {
extern std::map<uint64_t, PendingTransferV2> g_pendingTransfersV2;
extern std::mutex g_pendingTransfersV2Mtx;
class CSplitterBar : public CWnd {
public:
BOOL Create(CWnd* pParent);
DECLARE_MESSAGE_MAP()
protected:
bool m_bDragging = false;
afx_msg void OnLButtonDown(UINT nFlags, CPoint pt);
afx_msg void OnMouseMove(UINT nFlags, CPoint pt);
afx_msg void OnLButtonUp(UINT nFlags, CPoint pt);
afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
afx_msg void OnPaint();
};
// CMy2015RemoteDlg 对话框
class CMy2015RemoteDlg : public CDialogLangEx
{
@@ -319,6 +333,8 @@ public:
std::vector<int> m_PendingOffline; // 存储端口号
CListCtrlEx m_CList_Online;
CListCtrl m_CList_Message;
CSplitterBar m_SplitterBar;
int m_nSplitPos = 160; // 消息区高度(像素),可拖动调整
std::vector<context*> m_HostList; // 虚拟列表数据源(全部客户端)
std::unordered_map<uint64_t, size_t> m_ClientIndex; // clientID -> m_HostList 索引映射
std::vector<size_t> m_FilteredIndices; // 当前分组过滤后的索引列表
@@ -612,4 +628,6 @@ public:
afx_msg void OnMenuUncompress();
afx_msg void OnUninstallSoftware();
afx_msg void OnViewHideLog();
afx_msg LRESULT OnSplitterMoved(WPARAM wParam, LPARAM lParam);
afx_msg LRESULT OnSplitterReleased(WPARAM wParam, LPARAM lParam);
};