From 4093776c3b5c62bf07a6b9c201d8639514ad7b51 Mon Sep 17 00:00:00 2001 From: giantpune Date: Tue, 12 May 2009 07:02:17 +0000 Subject: [PATCH] Change the scrollbar behavior based on the pagesize in theme. --- source/libwiigui/gui_gamebrowser.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/libwiigui/gui_gamebrowser.cpp b/source/libwiigui/gui_gamebrowser.cpp index fa8d7795..5a7ea1ff 100644 --- a/source/libwiigui/gui_gamebrowser.cpp +++ b/source/libwiigui/gui_gamebrowser.cpp @@ -532,8 +532,8 @@ void GuiGameBrowser::Update(GuiTrigger * t) //int position = t->wpad.ir.y - 50 - scrollbarBoxBtn->GetTop(); int position = t->wpad.ir.y - 32 - scrollbarBoxBtn->GetTop(); - //listOffset = (position * gameCnt)/180 - selectedItem; - listOffset = (position * gameCnt)/237 - selectedItem; + //listOffset = (position * gameCnt)/237 - selectedItem; + listOffset = (position * gameCnt)/(25.2 * pagesize) - selectedItem; if(listOffset <= 0) { @@ -547,10 +547,11 @@ void GuiGameBrowser::Update(GuiTrigger * t) } } - int positionbar = 237*(listOffset + selectedItem) / gameCnt; + //int positionbar = 237*(listOffset + selectedItem) / gameCnt; + int positionbar = (25.2 * pagesize)*(listOffset + selectedItem) / gameCnt; - if(positionbar > 216) - positionbar = 216; + if(positionbar > (24 * pagesize))//if(positionbar > 216) + positionbar = (24 * pagesize);//positionbar = 216; scrollbarBoxBtn->SetPosition(width/2-18+7, positionbar+8);