summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorElzorFox <elzorfox@ya.ru>2024-04-28 15:04:43 +0500
committerElzorFox <elzorfox@ya.ru>2024-04-28 15:04:43 +0500
commit9ab052d0edafb2c9a5f4a532efa94e5b305552c0 (patch)
treea52ec53571bb91f5b9550a747c584e503f953e3b /plugins
parentfee70e6ec67ac82806777db31cd1ebd1448d1451 (diff)
NewStory:
scroll 3 textline on MOUSEWHEEL (Windows default) set textline height as font FONT_INMSG height
Diffstat (limited to 'plugins')
-rw-r--r--plugins/NewStory/src/history_control.cpp14
-rw-r--r--plugins/NewStory/src/history_control.h5
2 files changed, 11 insertions, 8 deletions
diff --git a/plugins/NewStory/src/history_control.cpp b/plugins/NewStory/src/history_control.cpp
index d4da49277d..a3ea867b5b 100644
--- a/plugins/NewStory/src/history_control.cpp
+++ b/plugins/NewStory/src/history_control.cpp
@@ -63,6 +63,8 @@ NewstoryListData::NewstoryListData(HWND _1) :
bSortAscending = g_plugin.bSortAscending;
redrawTimer.OnEvent = Callback(this, &NewstoryListData::onTimer_Draw);
+
+ iLineHeigth = GetFontHeight(g_fontTable[FONT_INMSG].lf);
}
void NewstoryListData::onTimer_Draw(CTimer *pTimer)
@@ -992,18 +994,18 @@ void NewstoryListData::TryUp(int iCount)
/////////////////////////////////////////////////////////////////////////////////////////
// Navigation by coordinates
-void NewstoryListData::LineUp()
+void NewstoryListData::LineUp(int iCount)
{
if (AtTop())
TryUp(1);
else
- ScrollUp(10);
+ ScrollUp(iLineHeigth * iCount);
}
-void NewstoryListData::LineDown()
+void NewstoryListData::LineDown(int iCount)
{
if (!AtBottom())
- ScrollDown(10);
+ ScrollDown(iLineHeigth * iCount);
}
void NewstoryListData::PageUp()
@@ -1473,9 +1475,9 @@ LRESULT CALLBACK NewstoryListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
case WM_MOUSEWHEEL:
if ((short)HIWORD(wParam) < 0)
- data->LineDown();
+ data->LineDown(3);
else
- data->LineUp();
+ data->LineUp(3);
return TRUE;
case WM_VSCROLL:
diff --git a/plugins/NewStory/src/history_control.h b/plugins/NewStory/src/history_control.h
index 0a679ff00b..afdaa7e67e 100644
--- a/plugins/NewStory/src/history_control.h
+++ b/plugins/NewStory/src/history_control.h
@@ -107,6 +107,7 @@ struct NewstoryListData : public MZeroedObject
int cachedMaxDrawnItem = -1;
int cachedScrollbarPos = -1, cachedScrollbarMax = -1;
int totalCount;
+ int iLineHeigth;
RECT rcLastPaint;
MCONTACT m_hContact = INVALID_CONTACT_ID;
@@ -159,8 +160,8 @@ struct NewstoryListData : public MZeroedObject
int GetItemHeight(ItemData *pItem);
bool HasSelection() const;
void HitTotal(int yCurr, int yTotal);
- void LineUp();
- void LineDown();
+ void LineUp(int iCount = 1);
+ void LineDown(int iCount = 1);
ItemData* LoadItem(int idx);
void MarkRead(ItemData *pItem);
void OpenFolder();