mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
Merge pull request #220 from cuu/master
add DrawRect in multi_icon_item
This commit is contained in:
commit
7da6542a1e
@ -16,7 +16,7 @@ from UI.util_funcs import midRect,FileExists
|
|||||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||||
from UI.scroller import ListScroller
|
from UI.scroller import ListScroller
|
||||||
from UI.icon_pool import MyIconPool
|
from UI.icon_pool import MyIconPool
|
||||||
from UI.icon_item import IconItem
|
from UI.multi_icon_item import MultiIconItem
|
||||||
from UI.multilabel import MultiLabel
|
from UI.multilabel import MultiLabel
|
||||||
from UI.lang_manager import MyLangManager
|
from UI.lang_manager import MyLangManager
|
||||||
from UI.skin_manager import MySkinManager
|
from UI.skin_manager import MySkinManager
|
||||||
@ -274,13 +274,13 @@ class AboutPage(Page):
|
|||||||
if self._Screen != None:
|
if self._Screen != None:
|
||||||
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
|
if self._Screen._CanvasHWND != None and self._CanvasHWND == None:
|
||||||
self._HWND = self._Screen._CanvasHWND
|
self._HWND = self._Screen._CanvasHWND
|
||||||
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight) )
|
self._CanvasHWND = pygame.Surface( (self._Screen._Width,self._BGheight+50) )
|
||||||
|
|
||||||
self._PosX = self._Index*self._Screen._Width
|
self._PosX = self._Index*self._Screen._Width
|
||||||
self._Width = self._Screen._Width ## equal to screen width
|
self._Width = self._Screen._Width ## equal to screen width
|
||||||
self._Height = self._Screen._Height
|
self._Height = self._Screen._Height
|
||||||
|
|
||||||
bgpng = IconItem()
|
bgpng = MultiIconItem()
|
||||||
bgpng._ImgSurf = MyIconPool.GiveIconSurface("about_bg")
|
bgpng._ImgSurf = MyIconPool.GiveIconSurface("about_bg")
|
||||||
bgpng._MyType = ICON_TYPES["STAT"]
|
bgpng._MyType = ICON_TYPES["STAT"]
|
||||||
bgpng._Parent = self
|
bgpng._Parent = self
|
||||||
@ -307,7 +307,7 @@ class AboutPage(Page):
|
|||||||
|
|
||||||
def ScrollDown(self):
|
def ScrollDown(self):
|
||||||
dis = 10
|
dis = 10
|
||||||
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 50:
|
if abs(self._Scrolled) < (self._BGheight - self._Height)/2 + 100:
|
||||||
self._PosY -= dis
|
self._PosY -= dis
|
||||||
self._Scrolled -= dis
|
self._Scrolled -= dis
|
||||||
|
|
||||||
@ -350,14 +350,17 @@ class AboutPage(Page):
|
|||||||
self.ClearCanvas()
|
self.ClearCanvas()
|
||||||
#self._Ps.Draw()
|
#self._Ps.Draw()
|
||||||
|
|
||||||
self._Icons["bg"].NewCoord(self._Width/2,self._Height/2 + (self._BGheight - Height)/2 + self._Screen._TitleBar._Height)
|
|
||||||
self._Icons["bg"].Draw()
|
|
||||||
|
|
||||||
for i in self._MyList:
|
for i in self._MyList:
|
||||||
i.Draw()
|
i.Draw()
|
||||||
|
|
||||||
self._DrawOnce = True
|
self._DrawOnce = True
|
||||||
|
|
||||||
|
self._Icons["bg"].DrawRect((230,0,82,184),(228,0,82,184))
|
||||||
|
|
||||||
|
y = self._MyList[len(self._MyList)-1]._PosY+30
|
||||||
|
|
||||||
|
self._Icons["bg"].DrawRect(( (self._Width-191)/2,y,191,68),(65,232,191,68))
|
||||||
|
|
||||||
if self._HWND != None:
|
if self._HWND != None:
|
||||||
self._HWND.fill(MySkinManager.GiveColor("White"))
|
self._HWND.fill(MySkinManager.GiveColor("White"))
|
||||||
|
|
||||||
|
|||||||
@ -44,6 +44,10 @@ class MultiIconItem(IconItem):
|
|||||||
self._Width,self._Height),
|
self._Width,self._Height),
|
||||||
(0,self._IconIndex*self._IconHeight,self._IconWidth,self._IconHeight))
|
(0,self._IconIndex*self._IconHeight,self._IconWidth,self._IconHeight))
|
||||||
|
|
||||||
|
def DrawRect(self,rect1,rect2):
|
||||||
|
if self._ImgSurf != None:
|
||||||
|
self._Parent._CanvasHWND.blit(self._ImgSurf,rect1,rect2)
|
||||||
|
|
||||||
def Draw(self):
|
def Draw(self):
|
||||||
if self._Align==ALIGN["VCenter"]: #default
|
if self._Align==ALIGN["VCenter"]: #default
|
||||||
if self._Label != None:
|
if self._Label != None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user