diff options
author | George Hazan <george.hazan@gmail.com> | 2024-03-17 15:34:10 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2024-03-17 15:34:10 +0300 |
commit | 5784fc3a62b9136c6690ed45ec7b505f35512e08 (patch) | |
tree | 86b2547a18c1459750195ee71e7d4df4f4707930 | |
parent | 32cd08ae230797bf0287cda1d478265df3f9f61c (diff) |
NewStory: fix for input field's height
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index d8ffc53c3d..c23ea117d3 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -221,7 +221,7 @@ void NewstoryListData::BeginEditItem() return;
RECT rc; GetClientRect(m_hwnd, &rc);
- int height = rc.bottom - rc.top;
+ int height = rc.bottom - rc.top, width = rc.right - rc.left;
int top = scrollTopPixel;
int idx = scrollTopItem;
@@ -244,7 +244,7 @@ void NewstoryListData::BeginEditItem() wszText.Replace(L"\n", L"\r\n");
uint32_t dwStyle = WS_CHILD | WS_BORDER | WS_VSCROLL | ES_MULTILINE | ES_AUTOVSCROLL;
- hwndEditBox = CreateWindow(L"EDIT", wszText, dwStyle, 0, top, rc.right - rc.left, height, m_hwnd, NULL, g_plugin.getInst(), NULL);
+ hwndEditBox = CreateWindow(L"EDIT", wszText, dwStyle, 0, top, width, min(height, itemHeight), m_hwnd, NULL, g_plugin.getInst(), NULL);
mir_subclassWindow(hwndEditBox, HistoryEditWndProc);
SendMessage(hwndEditBox, WM_SETFONT, (WPARAM)g_fontTable[fontid].hfnt, 0);
SendMessage(hwndEditBox, EM_SETMARGINS, EC_RIGHTMARGIN, 100);
|