diff options
author | George Hazan <george.hazan@gmail.com> | 2023-10-18 21:03:41 +0300 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2023-10-18 21:03:41 +0300 |
commit | b6f4df821380405c6bfa4a53f9db3874173e4b32 (patch) | |
tree | 4e061dd2faaadb1404a07a5076d4c5ebc9586915 /plugins | |
parent | 6c76da02a883c5956cd5f2cf87ac107b5c207f26 (diff) |
NewStory: another attempt to fix SB_THUMBTRACK
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/NewStory/src/history_control.cpp | 7 | ||||
-rw-r--r-- | plugins/NewStory/src/stdafx.h | 2 |
2 files changed, 6 insertions, 3 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp index 0b1c045ff1..365ad3e8aa 100644 --- a/plugins/NewStory/src/history_control.cpp +++ b/plugins/NewStory/src/history_control.cpp @@ -375,9 +375,9 @@ void NewstoryListData::EnsureVisible(int item) RECT rc; GetClientRect(m_hwnd, &rc); int height = rc.bottom - rc.top; - int top = scrollTopPixel; int idx = scrollTopItem; int itemHeight = GetItemHeight(idx); + int top = itemHeight + scrollTopPixel; bool found = false; while (top < height) { if (idx == item) { @@ -1171,7 +1171,10 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM si.cbSize = sizeof(si); si.fMask = SIF_ALL; GetScrollInfo(hwnd, SB_VERT, &si); - data->EnsureVisible(si.nTrackPos); + + data->scrollTopItem = si.nTrackPos; + data->scrollTopPixel = 0; + data->FixScrollPosition(); break; default: diff --git a/plugins/NewStory/src/stdafx.h b/plugins/NewStory/src/stdafx.h index c22b02d497..70039c4c3f 100644 --- a/plugins/NewStory/src/stdafx.h +++ b/plugins/NewStory/src/stdafx.h @@ -40,11 +40,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. #include <m_fontservice.h> #include <m_history.h> #include <m_hotkeys.h> +#include <m_icolib.h> #include <m_json.h> #include <m_langpack.h> #include <m_message.h> #include <m_metacontacts.h> -#include <m_icolib.h> #include <m_options.h> #include <m_protocols.h> #include <m_protosvc.h> |