add languages into settings menu

This commit is contained in:
cuu
2018-12-01 14:11:27 +08:00
parent b3aea583a5
commit 152b2a8ac7
8 changed files with 334 additions and 38 deletions

View File

@@ -14,47 +14,21 @@ from UI.util_funcs import midRect,FileExists
from UI.keys_def import CurKeys
from UI.scroller import ListScroller
from UI.skin_manager import MySkinManager
from UI.lang_manager import MyLangManager
from UI.info_page_selector import InfoPageSelector
from list_item import ListItem
import myvars
class ListPageSelector(PageSelector):
_BackgroundColor = MySkinManager.GiveColor('Front')
def __init__(self):
self._PosX = 0
self._PosY = 0
self._Height = 0
self._Width = Width
def AnimateDraw(self,x2,y2):
pass
def Draw(self):
idx = self._Parent._PsIndex
if idx < len(self._Parent._MyList):
x = 2
y = self._Parent._MyList[idx]._PosY+1
h = self._Parent._MyList[idx]._Height -3
self._PosX = x
self._PosY = y
self._Height = h
aa_round_rect(self._Parent._CanvasHWND,
(x,y,self._Width-4,h),self._BackgroundColor,4,0,self._BackgroundColor)
class ListPage(Page):
_Icons = {}
_Selector=None
_FootMsg = ["Nav","","","Back","Enter"]
_FootMsg = [MyLangManager.Tr("Nav"),"","",MyLangManager.Tr("Back"),MyLangManager.Tr("Enter")]
_MyList = []
_ListFontObj = fonts["varela15"]
_ListFontObj = MyLangManager.TrFont("varela15")
_Scroller = None
@@ -71,11 +45,12 @@ class ListPage(Page):
self._CanvasHWND = self._Screen._CanvasHWND
ps = ListPageSelector()
ps = InfoPageSelector()
ps._Parent = self
ps._PosX = 2
self._Ps = ps
self._PsIndex = 0
# "" pkgname, label
alist = [["","Airplane","Airplane Mode"],
["","PowerOptions","Power Options"],
@@ -85,6 +60,7 @@ class ListPage(Page):
["","Brightness","BackLight Brightness"],
["","Storage",""],
["","Time","Timezone"],
["","Languages","Languages"],
["","Notification","Notification"],
["","Update", ""],
["","About", "About"],