summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2023-10-18 21:03:41 +0300
committerGeorge Hazan <george.hazan@gmail.com>2023-10-18 21:03:41 +0300
commitb6f4df821380405c6bfa4a53f9db3874173e4b32 (patch)
tree4e061dd2faaadb1404a07a5076d4c5ebc9586915 /plugins
parent6c76da02a883c5956cd5f2cf87ac107b5c207f26 (diff)
NewStory: another attempt to fix SB_THUMBTRACK
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewStory/src/history_control.cpp7
-rw-r--r--plugins/NewStory/src/stdafx.h2
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>