fix scrolling in browsers being reversed

This commit is contained in:
jacob1 2018-06-01 00:22:06 -04:00
parent 48a333f0de
commit 0e383e1045
4 changed files with 6 additions and 6 deletions

View File

@ -124,7 +124,7 @@ void LocalBrowserController::SetPage(int page)
void LocalBrowserController::SetPageRelative(int offset) void LocalBrowserController::SetPageRelative(int offset)
{ {
int page = std::min(std::max(browserModel->GetPageNum() + offset, 1), browserModel->GetPageCount()); int page = std::min(std::max(browserModel->GetPageNum() + offset, 1), browserModel->GetPageCount());
if(page != browserModel->GetPageCount()) if (page != browserModel->GetPageNum())
browserModel->UpdateSavesList(page); browserModel->UpdateSavesList(page);
} }

View File

@ -245,8 +245,8 @@ void LocalBrowserView::NotifySelectedChanged(LocalBrowserModel * sender)
void LocalBrowserView::OnMouseWheel(int x, int y, int d) void LocalBrowserView::OnMouseWheel(int x, int y, int d)
{ {
if(d) if (d)
c->SetPageRelative(d); c->SetPageRelative(-d);
} }
void LocalBrowserView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) void LocalBrowserView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)

View File

@ -137,7 +137,7 @@ void SearchController::SetPage(int page)
void SearchController::SetPageRelative(int offset) void SearchController::SetPageRelative(int offset)
{ {
int page = std::min(std::max(searchModel->GetPageNum() + offset, 1), searchModel->GetPageCount()); int page = std::min(std::max(searchModel->GetPageNum() + offset, 1), searchModel->GetPageCount());
if(page != searchModel->GetPageCount()) if (page != searchModel->GetPageNum())
searchModel->UpdateSaveList(page, searchModel->GetLastQuery()); searchModel->UpdateSaveList(page, searchModel->GetLastQuery());
} }

View File

@ -778,8 +778,8 @@ void SearchView::OnTick(float dt)
void SearchView::OnMouseWheel(int x, int y, int d) void SearchView::OnMouseWheel(int x, int y, int d)
{ {
if(d) if (d)
c->SetPageRelative(d); c->SetPageRelative(-d);
} }
void SearchView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt) void SearchView::OnKeyPress(int key, int scan, bool repeat, bool shift, bool ctrl, bool alt)
{ {