From 01894b3f4774f6fcb40c7799b51b61c073d9222f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 18 Jan 2024 18:51:39 +0300 Subject: =?UTF-8?q?fixes=20#4131=20(NewStory:=20=D0=B5=D1=81=D0=BB=D0=B8?= =?UTF-8?q?=20=D0=B2=D0=BE=D0=B4=D0=B8=D1=82=D1=8C=20=D0=BC=D1=8B=D1=88?= =?UTF-8?q?=D0=BA=D0=BE=D0=B9=20=D0=BF=D0=BE=D0=B2=D0=B5=D1=80=D1=85=20?= =?UTF-8?q?=D1=81=D0=BE=D0=BE=D0=B1=D1=89=D0=B5=D0=BD=D0=B8=D1=8F,=20?= =?UTF-8?q?=D0=BA=D0=BE=D1=82=D0=BE=D1=80=D0=BE=D0=B5=20=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D1=83=D0=B5=D1=82=D1=81=D1=8F,?= =?UTF-8?q?=20=D0=BF=D0=BE=D1=8F=D0=B2=D0=BB=D1=8F=D1=8E=D1=82=D1=81=D1=8F?= =?UTF-8?q?=20=D0=B3=D0=BB=D0=B8=D1=82=D1=87=D0=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/NewStory/src/history_control.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'plugins') diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 295a49a4e2..2e7f799833 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -247,6 +247,7 @@ void NewstoryListData::BeginEditItem() SendMessage(hwndEditBox, EM_SETMARGINS, EC_RIGHTMARGIN, 100); ShowWindow(hwndEditBox, SW_SHOW); SetFocus(hwndEditBox); + SetForegroundWindow(hwndEditBox); } ///////////////////////////////////////////////////////////////////////////////////////// @@ -1133,9 +1134,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM int height = rc.bottom - rc.top; int width = rc.right - rc.left; int top = data->scrollTopPixel; - idx = data->scrollTopItem; - while ((top < height) && (idx < data->totalCount)) - top += data->PaintItem(hdc, data->LoadItem(idx++), top, width, true); + + for (idx = data->scrollTopItem; top < height && idx < data->totalCount; idx++) + top += data->PaintItem(hdc, data->LoadItem(idx), top, width, !data->hwndEditBox || data->caret != idx); + data->cachedMaxDrawnItem = idx; if (top <= height) { -- cgit v1.2.3