diff options
author | George Hazan <ghazan@miranda.im> | 2022-10-30 18:54:56 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-10-30 18:54:56 +0300 |
commit | c657140a8aba3e92154c8ca2622c74308ccdf19c (patch) | |
tree | 2eb30502e8d7f9b22f642df57d8ec44b97e977a9 /plugins/DbEditorPP | |
parent | 3eb922de103ba874b48a88c9fc0c68a82260866e (diff) |
fixes #3232 (DbEditorPP: splitter is broken)
Diffstat (limited to 'plugins/DbEditorPP')
-rw-r--r-- | plugins/DbEditorPP/src/main_window.cpp | 18 | ||||
-rw-r--r-- | plugins/DbEditorPP/src/version.h | 2 |
2 files changed, 8 insertions, 12 deletions
diff --git a/plugins/DbEditorPP/src/main_window.cpp b/plugins/DbEditorPP/src/main_window.cpp index b0b8221c22..20a066e0ed 100644 --- a/plugins/DbEditorPP/src/main_window.cpp +++ b/plugins/DbEditorPP/src/main_window.cpp @@ -356,22 +356,18 @@ int CMainDlg::Resizer(UTILRESIZECONTROL *urc) void CMainDlg::onChange_Splitter(CSplitter *)
{
- RECT rc2;
- GetWindowRect(m_hwnd, &rc2);
-
RECT rc;
- GetClientRect(m_hwnd, &rc);
- POINT pt = { m_splitter.GetPos(), 0 };
- ScreenToClient(m_hwnd, &pt);
+ GetWindowRect(m_hwnd, &rc);
- m_splitterPos = rc.left + pt.x + 1;
+ m_splitterPos = m_splitter.GetPos() + 1;
if (m_splitterPos < 150)
m_splitterPos = 150;
- if (m_splitterPos > rc2.right - rc2.left - 150)
- m_splitterPos = rc2.right - rc2.left - 150;
- SetWindowLongPtr(GetDlgItem(m_hwnd, IDC_SPLITTER), GWLP_USERDATA, m_splitterPos);
- g_plugin.setWord("Splitter", (uint16_t)m_splitterPos);
+ int iMaxPanelWidth = rc.right - rc.left - 150;
+ if (m_splitterPos > iMaxPanelWidth)
+ m_splitterPos = iMaxPanelWidth;
+
+ g_plugin.setWord("Splitter", (uint16_t)m_splitterPos);
PostMessage(m_hwnd, WM_SIZE, 0, 0);
}
diff --git a/plugins/DbEditorPP/src/version.h b/plugins/DbEditorPP/src/version.h index fa2aa48a4c..68642e1da0 100644 --- a/plugins/DbEditorPP/src/version.h +++ b/plugins/DbEditorPP/src/version.h @@ -1,7 +1,7 @@ #define __MAJOR_VERSION 4 #define __MINOR_VERSION 1 #define __RELEASE_NUM 0 -#define __BUILD_NUM 2 +#define __BUILD_NUM 3 #include <stdver.h> |