mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
Merge pull request #23 from cuu/master
Fix super long list overlap display problem in Emulator
This commit is contained in:
commit
0aa4b5c5d7
@ -204,7 +204,7 @@ class AboutPage(Page):
|
||||
memory = {}
|
||||
memory["key"] = "memory"
|
||||
memory["label"] = "Memory:"
|
||||
memory["value"] = str( int(parts[1].strip())/1000.0) +" Mb"
|
||||
memory["value"] = str( int(parts[1].strip())/1000.0) +" MB"
|
||||
self._AList["memory"] = memory
|
||||
break
|
||||
|
||||
|
||||
@ -326,6 +326,12 @@ class MusicLibListPage(Page):
|
||||
i._Active = True
|
||||
else:
|
||||
i._Active = False
|
||||
|
||||
if i._PosY > self._Height + self._Height/2:
|
||||
break
|
||||
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
|
||||
i.Draw()
|
||||
|
||||
@ -339,5 +345,11 @@ class MusicLibListPage(Page):
|
||||
i._Active = True
|
||||
else:
|
||||
i._Active = False
|
||||
|
||||
|
||||
if i._PosY > self._Height + self._Height/2:
|
||||
break
|
||||
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
|
||||
i.Draw()
|
||||
|
||||
@ -68,6 +68,8 @@ class PlayListPage(Page):
|
||||
_BGpng = None
|
||||
_BGwidth = 75
|
||||
_BGheight = 70
|
||||
|
||||
_Scrolled = 0
|
||||
|
||||
def __init__(self):
|
||||
self._Icons = {}
|
||||
@ -189,7 +191,7 @@ class PlayListPage(Page):
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._MyList[i]._Height
|
||||
|
||||
self._Scrolled +=1
|
||||
|
||||
def ScrollDown(self):
|
||||
if len(self._MyList) == 0:
|
||||
@ -202,7 +204,23 @@ class PlayListPage(Page):
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY -= self._MyList[i]._Height
|
||||
self._Scrolled -=1
|
||||
|
||||
def SyncScroll(self):# show where it left
|
||||
if self._Scrolled == 0:
|
||||
return
|
||||
|
||||
if self._PsIndex < len(self._MyList):
|
||||
cur_li = self._MyList[self._PsIndex]
|
||||
if self._Scrolled > 0:
|
||||
if cur_li._PosY < 0:
|
||||
for i in range(0, len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
elif self._Scrolled < 0:
|
||||
if cur_li._PosY +cur_li._Height > self._Height:
|
||||
for i in range(0,len(self._MyList)):
|
||||
self._MyList[i]._PosY += self._Scrolled * self._MyList[i]._Height
|
||||
|
||||
def Click(self):
|
||||
if len(self._MyList) == 0:
|
||||
return
|
||||
@ -215,9 +233,10 @@ class PlayListPage(Page):
|
||||
self._Screen.Draw()
|
||||
self._Screen.SwapAndShow()
|
||||
|
||||
def OnReturnBackCb(self):
|
||||
def OnReturnBackCb(self): # return from music_lib_list_page
|
||||
self.SyncList()
|
||||
|
||||
self.SyncScroll()
|
||||
|
||||
def KeyDown(self,event):
|
||||
if event.key == CurKeys["A"] or event.key == CurKeys["Menu"]:
|
||||
if myvars.Poller != None:
|
||||
@ -268,6 +287,12 @@ class PlayListPage(Page):
|
||||
self._Ps._Width = self._Width - 11
|
||||
self._Ps.Draw()
|
||||
for i in self._MyList:
|
||||
if i._PosY > self._Height + self._Height/2:
|
||||
break
|
||||
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
|
||||
i.Draw()
|
||||
self._Scroller.UpdateSize( len(self._MyList)*ListItem._Height, self._PsIndex*ListItem._Height)
|
||||
self._Scroller.Draw()
|
||||
@ -275,5 +300,12 @@ class PlayListPage(Page):
|
||||
self._Ps._Width = self._Width
|
||||
self._Ps.Draw()
|
||||
for i in self._MyList:
|
||||
|
||||
if i._PosY > self._Height + self._Height/2:
|
||||
break
|
||||
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
|
||||
i.Draw()
|
||||
|
||||
|
||||
@ -414,7 +414,14 @@ class FavListPage(Page):
|
||||
self._Ps.Draw()
|
||||
|
||||
for i in self._MyList:
|
||||
if i._PosY > self._Height + self._Height/2:
|
||||
break
|
||||
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
|
||||
i.Draw()
|
||||
|
||||
self._Scroller.UpdateSize( len(self._MyList)*ListItem._Height, self._PsIndex*ListItem._Height)
|
||||
self._Scroller.Draw()
|
||||
|
||||
|
||||
@ -453,7 +453,13 @@ class RomListPage(Page):
|
||||
self._Ps.Draw()
|
||||
|
||||
for i in self._MyList:
|
||||
if i._PosY > self._Height + self._Height/2:
|
||||
break
|
||||
|
||||
if i._PosY < 0:
|
||||
continue
|
||||
i.Draw()
|
||||
|
||||
self._Scroller.UpdateSize( len(self._MyList)*ListItem._Height, self._PsIndex*ListItem._Height)
|
||||
self._Scroller.Draw()
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user