From 5784fc3a62b9136c6690ed45ec7b505f35512e08 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 17 Mar 2024 15:34:10 +0300 Subject: NewStory: fix for input field's height --- plugins/NewStory/src/history_control.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') 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); -- cgit v1.2.3