Merge pull request #187 from cuu/gcores

Gcores
This commit is contained in:
GNU 2019-05-05 12:03:23 +08:00 committed by GitHub
commit c05da6de97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 163 additions and 130 deletions

View File

@ -15,19 +15,18 @@ from UI.keys_def import CurKeys, IsKeyMenuOrB
from UI.slider import Slider from UI.slider import Slider
from UI.icon_pool import MyIconPool from UI.icon_pool import MyIconPool
from UI.multi_icon_item import MultiIconItem from UI.multi_icon_item import MultiIconItem
from UI.skin_manager import MySkinManager
from config import BackLight from config import BackLight
import myvars import myvars
class BSlider(Slider): class BSlider(Slider):
OnChangeCB = None OnChangeCB = None
_BGpng = None
_BGwidth = 179
_BGheight = 153
_NeedleSurf = None
_Scale = None
_Parent = None _Parent = None
_Icons = {} _Icons = {}
@ -38,22 +37,11 @@ class BSlider(Slider):
self._Width = self._Parent._Width self._Width = self._Parent._Width
self._Height = self._Parent._Height self._Height = self._Parent._Height
bgpng = IconItem() self._BrightnessLabel = Label()
bgpng._ImgSurf = MyIconPool._Icons["light"] self._BrightnessLabel.SetCanvasHWND(self._CanvasHWND)
bgpng._MyType = ICON_TYPES["STAT"] self._BrightnessLabel.Init("BRIGHT",MySkinManager.GiveFont("EurostileBold13"))
bgpng._Parent = self self._BrightnessLabel.SetColor(MySkinManager.GiveColor('Text'))
bgpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
self._Icons["bg"] = bgpng
##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA )
scale = MultiIconItem()
scale._MyType = ICON_TYPES["STAT"]
scale._Parent = self
scale._ImgSurf = MyIconPool._Icons["scale"]
scale._IconWidth = 82
scale._IconHeight = 63
scale.Adjust(0,0,82,63,0)
self._Icons["scale"] = scale
def SetValue(self,brt): def SetValue(self,brt):
self._Value = brt self._Value = brt
@ -78,25 +66,38 @@ class BSlider(Slider):
self.OnChangeCB(self._Value) self.OnChangeCB(self._Value)
def Draw(self): def Draw(self):
start_x = 82
start_y = self._Parent._Screen._Height/2-5
height = 30
width = 4
padding = 15
seg = self._Value-1
self._Icons["bg"].NewCoord(self._Width/2,self._Height/2 +11 ) for i in range(0,9):
self._Icons["bg"].Draw() rect = pygame.Rect(start_x+i*(width+padding),start_y,width,height)
if i > seg:
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 1)
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,1, MySkinManager.GiveColor('White'))
else:
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 0)
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,0, MySkinManager.GiveColor('White'))
self._Icons["scale"].NewCoord(self._Width/2,self._Height/2 ) self._BrightnessLabel.NewCoord(118,self._Parent._Screen._Height/2-30)
self._BrightnessLabel.Draw(True)
icon_idx = self._Value - 1 minus_box_rect = pygame.Rect(start_x- (4+6)*4,start_y,6*4,30)
if icon_idx < 0: pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),minus_box_rect, 0)
icon_idx = 0
self._Icons["scale"]._IconIndex = icon_idx minus_rect = pygame.Rect(start_x-8*4,start_y+14,2*4,2)
self._Icons["scale"].Draw() pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),minus_rect, 0)
"""
pygame.draw.line(self._CanvasHWND,(255,0,0), (posx,self._PosY),(self._Width,self._PosY),3) ## range line
pygame.draw.line(self._CanvasHWND,(0,0,255), (self._PosX,self._PosY),(posx,self._PosY),3) ## range line
pygame.draw.circle(self._CanvasHWND,(255,255,255),( posx, self._PosY),7,0) plus_box_rect = pygame.Rect(start_x + 39*4 +4*4,start_y,6*4,30)
pygame.draw.circle(self._CanvasHWND,(0,0,0) ,( posx, self._PosY),7,1)## outer border pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),plus_box_rect, 0)
"""
cross1_rect = pygame.Rect(start_x+39*4+4*4+2*4,start_y+14,2*4,2)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross1_rect, 0)
cross2_rect = pygame.Rect(start_x+39*4+4*4+2*4+3,start_y+14-3,2,2*4)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross2_rect, 0)

View File

@ -15,25 +15,19 @@ from UI.util_funcs import midRect
from UI.keys_def import CurKeys, IsKeyMenuOrB from UI.keys_def import CurKeys, IsKeyMenuOrB
from UI.slider import Slider from UI.slider import Slider
from UI.multi_icon_item import MultiIconItem from UI.multi_icon_item import MultiIconItem
from UI.skin_manager import MySkinManager
from UI.icon_pool import MyIconPool from UI.icon_pool import MyIconPool
from libs.roundrects import aa_round_rect
import myvars import myvars
class SoundSlider(Slider): class SoundSlider(Slider):
OnChangeCB = None OnChangeCB = None
_BGpng = None
_BGwidth = 192
_BGheight = 173
_NeedleSurf = None
_Scale = None
_Parent = None _Parent = None
_VolumeLabel =None
snd_segs = [ [0,20],[21,40],[41,50],[51,60],[61,70],[71,85],[86,90],[91,95],[96,100] ]
def __init__(self): def __init__(self):
Slider.__init__(self) Slider.__init__(self)
@ -42,64 +36,67 @@ class SoundSlider(Slider):
self._Width = self._Parent._Width self._Width = self._Parent._Width
self._Height = self._Parent._Height self._Height = self._Parent._Height
self._BGpng = IconItem() self._VolumeLabel = Label()
self._BGpng._ImgSurf = MyIconPool._Icons["vol"] self._VolumeLabel.SetCanvasHWND(self._CanvasHWND)
self._BGpng._MyType = ICON_TYPES["STAT"] self._VolumeLabel.Init("VOLUME",MySkinManager.GiveFont("EurostileBold13"))
self._BGpng._Parent = self self._VolumeLabel.SetColor(MySkinManager.GiveColor('Text'))
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
##self._NeedleSurf = pygame.Surface( (38,12),pygame.SRCALPHA )
self._Scale = MultiIconItem()
self._Scale._MyType = ICON_TYPES["STAT"]
self._Scale._Parent = self
self._Scale._ImgSurf = MyIconPool._Icons["scale"]
self._Scale._IconWidth = 82
self._Scale._IconHeight = 63
self._Scale.Adjust(0,0,82,63,0)
def SetValue(self,vol):#pct 0-100 def SetValue(self,vol):#pct 0-100
for i,v in enumerate(self.snd_segs): if vol >= 0 and vol <= 100:
if vol >= v[0] and vol <= v[1]: self._Value = vol
self._Value = i # self._Value : 0 - 8
break
def Further(self): def Further(self):
self._Value+=1 self._Value+=5
if self._Value > len(self.snd_segs)-1: if self._Value > 100:
self._Value = len(self.snd_segs) -1 self._Value = 100
vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2
if self.OnChangeCB != None: if self.OnChangeCB != None:
if callable(self.OnChangeCB): if callable(self.OnChangeCB):
self.OnChangeCB( vol ) self.OnChangeCB( self._Value )
def StepBack(self): def StepBack(self):
self._Value-=1 self._Value-=5
if self._Value < 0: if self._Value < 0:
self._Value = 0 self._Value = 0
vol = self.snd_segs[self._Value][0] + (self.snd_segs[self._Value][1] - self.snd_segs[self._Value][0])/2
if self.OnChangeCB != None: if self.OnChangeCB != None:
if callable(self.OnChangeCB): if callable(self.OnChangeCB):
self.OnChangeCB( vol ) self.OnChangeCB( self._Value )
def Draw(self): def Draw(self):
start_x = 82
start_y = self._Parent._Screen._Height/2-5
height = 30
width = 4
seg = self._Value / 5
self._BGpng.NewCoord(self._Width/2,self._Height/2 ) for i in range(0, 20):
self._BGpng.Draw() rect = pygame.Rect(start_x+i*(width*2),start_y,width,height)
if i > seg:
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 1)
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,1, MySkinManager.GiveColor('White'))
else:
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect, 0)
#aa_round_rect(self._CanvasHWND,rect, MySkinManager.GiveColor('Text'),1,0, MySkinManager.GiveColor('White'))
self._Scale.NewCoord(self._Width/2,self._Height/2) self._VolumeLabel.NewCoord(118,self._Parent._Screen._Height/2-30)
self._VolumeLabel.Draw(True)
self._Scale._IconIndex = self._Value minus_box_rect = pygame.Rect(start_x- (4+6)*4,start_y,6*4,30)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),minus_box_rect, 0)
self._Scale.Draw() minus_rect = pygame.Rect(start_x-8*4,start_y+14,2*4,2)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),minus_rect, 0)
plus_box_rect = pygame.Rect(start_x + 39*4 +4*4,start_y,6*4,30)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),plus_box_rect, 0)
cross1_rect = pygame.Rect(start_x+39*4+4*4+2*4,start_y+14,2*4,2)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross1_rect, 0)
cross2_rect = pygame.Rect(start_x+39*4+4*4+2*4+3,start_y+14-3,2,2*4)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('White'),cross2_rect, 0)
class SoundPage(Page): class SoundPage(Page):

View File

@ -13,8 +13,6 @@ from UI.icon_pool import MyIconPool
from UI.label import Label from UI.label import Label
from UI.util_funcs import midRect from UI.util_funcs import midRect
from libs.roundrects import aa_round_rect
class StoragePage(Page): class StoragePage(Page):
_Icons = {} _Icons = {}
@ -24,10 +22,10 @@ class StoragePage(Page):
_BGlabel = None _BGlabel = None
_FreeLabel = None _FreeLabel = None
_BGmsg = "%.1fGB of %.1fGB Used" _GBmsg = "%.1fGB of %.1fGB Used"
_DskUsg = None _DskUsg = None
_HighColor = MySkinManager.GiveColor('High') _TextColor = MySkinManager.GiveColor('Text')
_FootMsg = ["Nav.","","","Back",""] _FootMsg = ["Nav.","","","Back",""]
def __init__(self): def __init__(self):
@ -53,60 +51,83 @@ class StoragePage(Page):
self._Width = self._Screen._Width self._Width = self._Screen._Width
self._Height = self._Screen._Height self._Height = self._Screen._Height
self._BGpng = IconItem() self._GBLabel = Label()
self._BGpng._ImgSurf = MyIconPool._Icons["icon_sd"] self._GBLabel.SetCanvasHWND(self._CanvasHWND)
self._BGpng._MyType = ICON_TYPES["STAT"] self._GBLabel.Init(self._GBmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]),MySkinManager.GiveFont("varela11") )
self._BGpng._Parent = self self._GBLabel.SetColor(self._TextColor)
self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), MySkinManager.GiveFont("varela15")) self._PctLabel = Label()
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0) self._PctLabel.SetCanvasHWND(self._CanvasHWND)
self._BGlabel = Label()
self._BGlabel.SetCanvasHWND(self._CanvasHWND)
usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0 usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0
self._BGlabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("varela25"))
self._BGlabel.SetColor( self._HighColor ) self._PctLabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("EurostileBold30"))
self._PctLabel.SetColor( self._TextColor )
self._FreeLabel = Label() self._FreeLabel = Label()
self._FreeLabel.SetCanvasHWND(self._CanvasHWND) self._FreeLabel.SetCanvasHWND(self._CanvasHWND)
self._FreeLabel.Init("Free",MySkinManager.GiveFont("varela13")) self._FreeLabel.Init("FREE",MySkinManager.GiveFont("Eurostile12"))
self._FreeLabel.SetColor(self._BGlabel._Color) self._FreeLabel.SetColor(self._PctLabel._Color)
def OnLoadCb(self): def OnLoadCb(self):
pass pass
def DrawCross(self,topleft,top):
start_x = topleft
start_y = top
width = 2
height = 10
padding = 4
rect1 = pygame.Rect(start_x+padding,start_y,width,height)
rect2 = pygame.Rect(start_x,start_y+padding,height,width)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect1, 0)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect2, 0)
def Draw(self): def Draw(self):
self.ClearCanvas() self.ClearCanvas()
self._BGpng.NewCoord(self._Width/2,self._Height/2-10) self._PctLabel.NewCoord(32,102- 33)
self._BGpng.Draw() self._PctLabel.Draw()
self._BGlabel.NewCoord(self._Width/2-28,self._Height/2-30)
self._BGlabel.Draw()
self._FreeLabel.NewCoord(self._BGlabel._PosX+10 ,self._Height/2) self._FreeLabel.NewCoord(33 ,130-25)
self._FreeLabel.Draw() self._FreeLabel.Draw()
self._GBLabel.NewCoord(145,103-29)
self._GBLabel.Draw()
#bgcolor = (238,238,238), fgcolor = (126,206,244) #bgcolor = (238,238,238), fgcolor = (126,206,244)
#aa_round_rect
usage_percent = (self._DskUsg[0]/self._DskUsg[1] ) usage_percent = (self._DskUsg[0]/self._DskUsg[1] )
if usage_percent < 0.1: if usage_percent < 0.1:
usage_percent = 0.1 usage_percent = 0.1
rect_ = midRect(self._Width/2,self._Height-30,170,17, Width,Height) rect_ = pygame.Rect(144,118-25, 283-144,139-117)
aa_round_rect(self._CanvasHWND, rect_, MySkinManager.GiveColor('Line'), 5, 0, MySkinManager.GiveColor('Line')) pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'), rect_, 1)
rect2 = midRect(self._Width/2,self._Height-30,int(170*(1.0-usage_percent)),17, Width,Height) rect2 = pygame.Rect(144,118-25,int((283-144)*(1.0-usage_percent)),139-117)
rect2.left = rect_.left rect2.left = rect_.left
rect2.top = rect_.top rect2.top = rect_.top
aa_round_rect(self._CanvasHWND,rect2, MySkinManager.GiveColor('Front'),5,0,MySkinManager.GiveColor('Front')) pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Text'),rect2, 0)
sep_rect = pygame.Rect(129,99-25,2,42)
pygame.draw.rect(self._CanvasHWND,MySkinManager.GiveColor('Inactive'),sep_rect, 0)
##4 cross
self.DrawCross(10,10)
self.DrawCross(self._Screen._Width-20,10)
self.DrawCross(10,self._Screen._Height-20)
self.DrawCross(self._Screen._Width-20,self._Screen._Height-20)
class APIOBJ(object): class APIOBJ(object):

View File

@ -8,6 +8,8 @@ import pygame
from UI.page import Page from UI.page import Page
from UI.label import Label from UI.label import Label
from UI.lang_manager import MyLangManager from UI.lang_manager import MyLangManager
from UI.skin_manager import MySkinManager
# a item for List # a item for List
# - - - - - - - - - - - -- # - - - - - - - - - - - --
# | Icon Text..... > | # | Icon Text..... > |
@ -50,6 +52,6 @@ class ListItem(object):
self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2 self._Labels["Text"]._PosY = self._PosY + (self._Height - self._Labels["Text"]._Height)/2
self._Labels["Text"].Draw() self._Labels["Text"].Draw()
pygame.draw.line(self._Parent._CanvasHWND,(169,169,169),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1) pygame.draw.line(self._Parent._CanvasHWND,MySkinManager.GiveColor('Line'),(self._PosX,self._PosY+self._Height-1),(self._PosX+self._Width,self._PosY+self._Height-1),1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.9 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 599 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 294 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 12 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 111 B

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 198 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 875 B

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 335 B

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 545 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 427 B

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 601 B

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 673 B

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 627 B

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

Binary file not shown.

View File

@ -100,7 +100,7 @@ class RomListPage(Page):
_Selector=None _Selector=None
_FootMsg = ["Nav","Del","Scan","Back","Run","AddFav"] _FootMsg = ["Nav","Del","Scan","Back","Run","AddFav"]
_MyList = [] _MyList = []
_ListFont = MyLangManager.Tr("notosanscjk15") _ListFont = MyLangManager.TrFont("notosanscjk15")
_MyStack = None _MyStack = None
_Emulator = None _Emulator = None
_Parent = None _Parent = None

View File

@ -157,7 +157,7 @@ class Page(Widget):
ps = PageSelector() ps = PageSelector()
ps._IconSurf = MyIconPool._Icons["blueselector"] ps._IconSurf = MyIconPool._Icons["blueselector"]
ps._Parent = self ps._Parent = self
ps.Init(start_x,start_y,92,92,128) ps.Init(start_x,start_y,MyIconPool._Sizes["blueselector"][0],MyIconPool._Sizes["blueselector"][1],128)
self._Ps = ps self._Ps = ps
self._PsIndex = 0 self._PsIndex = 0
@ -209,7 +209,7 @@ class Page(Widget):
ps = PageSelector() ps = PageSelector()
ps._IconSurf = MyIconPool._Icons["blueselector"] ps._IconSurf = MyIconPool._Icons["blueselector"]
ps._Parent = self ps._Parent = self
ps.Init(start_x,start_y,92,92,128) ps.Init(start_x,start_y,MyIconPool._Sizes["blueselector"][0],MyIconPool._Sizes["blueselector"][1],128)
self._Ps = ps self._Ps = ps
self._PsIndex = 0 self._PsIndex = 0
@ -247,7 +247,7 @@ class Page(Widget):
ps = PageSelector() ps = PageSelector()
ps._IconSurf = MyIconPool._Icons["blueselector"] ps._IconSurf = MyIconPool._Icons["blueselector"]
ps._Parent = self ps._Parent = self
ps.Init(icon_width/2,icon_height/2,92,92,128) ps.Init(icon_width/2,icon_height/2,MyIconPool._Sizes["blueselector"][0],MyIconPool._Sizes["blueselector"][1],128)
self._Ps = ps self._Ps = ps
self._PsIndex = 0 self._PsIndex = 0
self._OnShow = False self._OnShow = False
@ -270,7 +270,7 @@ class Page(Widget):
ps = PageSelector() ps = PageSelector()
ps._IconSurf = MyIconPool._Icons["blueselector"] ps._IconSurf = MyIconPool._Icons["blueselector"]
ps._Parent = self ps._Parent = self
ps.Init(start_x,start_y,92,92,128) ps.Init(start_x,start_y,MyIconPool._Sizes["blueselector"][0],MyIconPool._Sizes["blueselector"][1],128)
self._Ps = ps self._Ps = ps
self._PsIndex = 0 self._PsIndex = 0
self._OnShow = False self._OnShow = False
@ -289,7 +289,7 @@ class Page(Widget):
ps = PageSelector() ps = PageSelector()
ps._IconSurf = MyIconPool._Icons["blueselector"] ps._IconSurf = MyIconPool._Icons["blueselector"]
ps._Parent = self ps._Parent = self
ps.Init(start_x,start_y-self._SelectedIconTopOffset,92,92,128) ps.Init(start_x,start_y-self._SelectedIconTopOffset,MyIconPool._Sizes["blueselector"][0],MyIconPool._Sizes["blueselector"][1],128)
self._Ps = ps self._Ps = ps
self._PsIndex = 0 self._PsIndex = 0
@ -325,7 +325,7 @@ class Page(Widget):
ps = PageSelector() ps = PageSelector()
ps._IconSurf = MyIconPool._Icons["blueselector"] ps._IconSurf = MyIconPool._Icons["blueselector"]
ps._Parent = self ps._Parent = self
ps.Init(start_x,start_y,icon_width+4,icon_height+4,128) ps.Init(start_x,start_y,MyIconPool._Sizes["blueselector"][0]+4,MyIconPool._Sizes["blueselector"][1]+4,128)
self._Ps = ps self._Ps = ps
self._PsIndex = 0 self._PsIndex = 0
self._OnShow = False self._OnShow = False
@ -648,6 +648,6 @@ class Page(Widget):
def Draw(self): def Draw(self):
self.ClearCanvas() self.ClearCanvas()
self.DrawIcons() self.DrawIcons()
self.DrawPageSelector() #self.DrawPageSelector()

View File

@ -47,10 +47,21 @@ class SkinManager(object):
skinpath = config.SKIN+"/truetype" skinpath = config.SKIN+"/truetype"
fonts_path = {} fonts_path = {}
fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath
print(fonts_path["varela"])
fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath
fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath
fonts_path["Eurostile"] = "%s/EurostileMN-Medium.pfb.ttf" %skinpath
fonts_path["EurostileBold"] = "%s/EurostileMN-ExtendedBold.pfb.ttf" % skinpath
self._Fonts["Eurostile10"] = pygame.font.Font(fonts_path["Eurostile"],10)
self._Fonts["Eurostile11"] = pygame.font.Font(fonts_path["Eurostile"],11)
self._Fonts["Eurostile12"] = pygame.font.Font(fonts_path["Eurostile"],12)
self._Fonts["Eurostile13"] = pygame.font.Font(fonts_path["Eurostile"],13)
self._Fonts["EurostileBold13"] = pygame.font.Font(fonts_path["EurostileBold"],13)
self._Fonts["EurostileBold30"] = pygame.font.Font(fonts_path["EurostileBold"],30)
for i in range(10,29): for i in range(10,29):
self._Fonts["varela%d"%i] = pygame.font.Font(fonts_path["varela"],i) self._Fonts["varela%d"%i] = pygame.font.Font(fonts_path["varela"],i)
@ -73,15 +84,16 @@ class SkinManager(object):
def SetColors(self): def SetColors(self):
Colors = {} Colors = {}
Colors["High"] = pygame.Color(51, 166, 255) Colors["High"] = pygame.Color(51, 166, 255)
Colors["Text"] = pygame.Color(83, 83, 83) Colors["Text"] = pygame.Color(42, 140, 121)
Colors["ReadOnlyText"] = pygame.Color(130,130,130) Colors["ReadOnlyText"] = pygame.Color(130,130,130)
Colors["Front"] = pygame.Color(131, 199, 219) Colors["Front"] = pygame.Color(131, 199, 219)
Colors["URL"] = pygame.Color(51, 166, 255) Colors["URL"] = pygame.Color(51, 166, 255)
Colors["Line"] = pygame.Color(169, 169, 169) Colors["Line"] = pygame.Color(42, 140, 121)
Colors["TitleBg"] = pygame.Color(228, 228, 228) Colors["TitleBg"] = pygame.Color(11, 16, 22)
Colors["Active"] = pygame.Color(175, 90, 0) Colors["Active"] = pygame.Color(175, 90, 0)
Colors["Inactive"] = pygame.Color(27,78,72)
Colors["Disabled"] = pygame.Color(204, 204, 204) Colors["Disabled"] = pygame.Color(204, 204, 204)
Colors["White"] = pygame.Color(255, 255, 255) Colors["White"] = pygame.Color(11, 16, 22)
Colors["Black"] = pygame.Color(0, 0, 0) Colors["Black"] = pygame.Color(0, 0, 0)
SkinManager._Colors = Colors SkinManager._Colors = Colors

View File

@ -12,7 +12,7 @@ MPD_socket = "/tmp/mpd.socket"
UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json" UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json"
VERSION="stable 1.24" VERSION="gcores stable 1.0"
SKIN="../skin/default" SKIN="../skin/default"