mirror of
https://github.com/clockworkpi/launcher.git
synced 2025-12-12 17:58:50 +01:00
empty fonts.py
This commit is contained in:
parent
d3b508c3a1
commit
25a191a4d0
@ -12,15 +12,14 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.icon_item import IconItem
|
||||
from UI.multilabel import MultiLabel
|
||||
|
||||
|
||||
from UI.lang_manager import MyLangManager
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
class InfoPageListItem(object):
|
||||
_PosX = 0
|
||||
@ -79,7 +78,7 @@ class InfoPageListItem(object):
|
||||
class AboutPage(Page):
|
||||
_FootMsg = ["Nav.","","","Back",""]
|
||||
_MyList = []
|
||||
_ListFontObj = fonts["varela13"]
|
||||
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||
|
||||
_AList = {}
|
||||
|
||||
@ -229,7 +228,7 @@ class AboutPage(Page):
|
||||
li._PosY = start_y + last_height
|
||||
li._Width = Width
|
||||
li._Fonts["normal"] = self._ListFontObj
|
||||
li._Fonts["small"] = fonts["varela12"]
|
||||
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||
|
||||
if self._AList[u]["label"] != "":
|
||||
li.Init( self._AList[u]["label"] )
|
||||
|
||||
@ -12,7 +12,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
|
||||
@ -15,7 +15,6 @@ from libs.DBUS import bus, adapter,devices
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -100,8 +99,8 @@ class BleInfoPage(Page):
|
||||
_FootMsg = ["Nav","Forget","Disconnect","Back",""]
|
||||
_MyList = []
|
||||
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||
_ListSmFontObj = fonts["varela12"] # small font
|
||||
_ListSm2FontObj= fonts["varela11"]
|
||||
_ListSmFontObj = MySkinManager.GiveFont("varela12") # small font
|
||||
_ListSm2FontObj= MySkinManager.GiveFont("varela11")
|
||||
|
||||
_AList = {}
|
||||
_Path = ""
|
||||
@ -380,7 +379,7 @@ class BluetoothPage(Page):
|
||||
_LastStatusMsg = ""
|
||||
_FootMsg = ["Nav","Info","Scan","Back","TryConnect"]
|
||||
_Scroller = None
|
||||
_ListFontObj = fonts["notosanscjk15"]
|
||||
_ListFontObj = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_InfoPage = None
|
||||
|
||||
|
||||
@ -5,7 +5,6 @@ import pygame
|
||||
## local UI import
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
|
||||
@ -10,7 +10,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.icon_item import IconItem
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
from UI.slider import Slider
|
||||
|
||||
@ -9,7 +9,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, GetButtonsLayoutMode, SetButtonsLayoutMode, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -117,7 +116,6 @@ class UpdateConfirmPage(ConfirmPage):
|
||||
class ButtonsLayoutPage(Page):
|
||||
_FootMsg = ["Nav.","","UpdateRetroArch","Back","Toggle"]
|
||||
_MyList = []
|
||||
_ListFontObj = fonts["varela13"]
|
||||
|
||||
_AList = {}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,FileExists
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -78,7 +77,7 @@ class PageListItem(InfoPageListItem):
|
||||
class GateWayPage(Page):
|
||||
_FootMsg = ["Nav","Clear All","","Back","Select"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_AList = {}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -77,7 +76,7 @@ class PageListItem(InfoPageListItem):
|
||||
class LanguagesPage(Page):
|
||||
_FootMsg = ["Nav","","","Back","Select"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_AList = {}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES,RESTARTUI
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,FileExists
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -77,7 +76,7 @@ class PageListItem(InfoPageListItem):
|
||||
class GPUDriverPage(Page):
|
||||
_FootMsg = ["Nav","","","Back","Select"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_AList = {}
|
||||
|
||||
|
||||
@ -15,7 +15,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,FileExists,IsExecutable
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -126,7 +125,7 @@ class NotificationPage(Page):
|
||||
li._PosY = start_y + counter*InfoPageListItem._Height
|
||||
li._Width = Width-10
|
||||
li._Fonts["normal"] = self._ListFontObj
|
||||
li._Fonts["small"] = fonts["varela12"]
|
||||
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||
|
||||
if IsExecutable(v):
|
||||
li._ReadOnly = True
|
||||
|
||||
@ -12,7 +12,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES,POWEROPT
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -292,7 +291,7 @@ class InfoPage(Page):
|
||||
class PowerOptionsPage(Page):
|
||||
_FootMsg = ["Nav","Detail","","Back","Select"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_AList = {}
|
||||
|
||||
|
||||
@ -11,7 +11,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.icon_item import IconItem
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
from UI.slider import Slider
|
||||
|
||||
@ -11,7 +11,6 @@ from UI.constants import ICON_TYPES,Width,Height
|
||||
from UI.icon_item import IconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
|
||||
from libs.roundrects import aa_round_rect
|
||||
@ -59,7 +58,7 @@ class StoragePage(Page):
|
||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||
self._BGpng._Parent = self
|
||||
|
||||
self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), fonts["varela15"])
|
||||
self._BGpng.AddLabel(self._BGmsg % (self._DskUsg[1]-self._DskUsg[0], self._DskUsg[1]), MySkinManager.GiveFont("varela15"))
|
||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
|
||||
|
||||
@ -68,12 +67,12 @@ class StoragePage(Page):
|
||||
|
||||
usage_percent = (self._DskUsg[0]/self._DskUsg[1] )*100.0
|
||||
|
||||
self._BGlabel.Init("%d%%"% int(usage_percent),fonts["varela25"])
|
||||
self._BGlabel.Init("%d%%"% int(usage_percent),MySkinManager.GiveFont("varela25"))
|
||||
self._BGlabel.SetColor( self._HighColor )
|
||||
|
||||
self._FreeLabel = Label()
|
||||
self._FreeLabel.SetCanvasHWND(self._CanvasHWND)
|
||||
self._FreeLabel.Init("Free",fonts["varela13"])
|
||||
self._FreeLabel.Init("Free",MySkinManager.GiveFont("varela13"))
|
||||
self._FreeLabel.SetColor(self._BGlabel._Color)
|
||||
|
||||
|
||||
|
||||
@ -7,7 +7,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import ICON_TYPES
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.util_funcs import midRect
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
@ -10,7 +10,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
@ -18,7 +17,7 @@ from UI.multi_icon_item import MultiIconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.scroller import ListScroller
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
from UI.lang_manager import MyLangManager
|
||||
from list_item import ListItem
|
||||
|
||||
|
||||
@ -86,7 +85,7 @@ class TimezoneListPage(Page):
|
||||
_FootMsg = ["Nav","","","Back","Select"]
|
||||
_MyList = []
|
||||
_SwapMyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
_MyStack = None
|
||||
|
||||
_Scroller = None
|
||||
@ -189,7 +188,7 @@ class TimezoneListPage(Page):
|
||||
self._BGpng._ImgSurf = MyIconPool._Icons["empty"]
|
||||
self._BGpng._MyType = ICON_TYPES["STAT"]
|
||||
self._BGpng._Parent = self
|
||||
self._BGpng.AddLabel("No timezones found on system!", fonts["varela22"])
|
||||
self._BGpng.AddLabel("No timezones found on system!", MyLangManager.TrFont("varela22"))
|
||||
self._BGpng.SetLableColor(MySkinManager.GiveColor('Disabled'))
|
||||
self._BGpng.Adjust(0,0,self._BGwidth,self._BGheight,0)
|
||||
|
||||
|
||||
@ -13,7 +13,6 @@ from UI.constants import ICON_TYPES,Width,Height,RUNEVT,RUNSH
|
||||
from UI.icon_item import IconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,CmdClean,get_git_revision_short_hash
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.confirm_page import ConfirmPage
|
||||
@ -157,7 +156,7 @@ class UpdatePage(Page):
|
||||
_Icons = {}
|
||||
_FootMsg = ["Nav","","Check Update","Back",""]
|
||||
|
||||
_ListFontObj = fonts["varela15"]
|
||||
_ListFontObj = MyLangManager.TrFont("varela15")
|
||||
_ConfirmPage = None
|
||||
_AList = {}
|
||||
_MyList = []
|
||||
@ -177,7 +176,7 @@ class UpdatePage(Page):
|
||||
li._PosY = start_y + i*InfoPageListItem._Height
|
||||
li._Width = Width
|
||||
li._Fonts["normal"] = self._ListFontObj
|
||||
li._Fonts["small"] = fonts["varela12"]
|
||||
li._Fonts["small"] = MySkinManager.GiveFont("varela12")
|
||||
|
||||
if self._AList[v]["label"] != "":
|
||||
li.Init( self._AList[v]["label"] )
|
||||
|
||||
@ -5,7 +5,6 @@ import pygame
|
||||
## local UI import
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
|
||||
@ -10,7 +10,6 @@ from wicd import misc
|
||||
from UI.constants import Width,Height
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,SwapAndShow
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
@ -94,7 +93,7 @@ class WifiInfoPage(Page):
|
||||
li._PosY = start_y + i*InfoPageListItem._Height
|
||||
li._Width = Width
|
||||
li._Fonts["normal"] = self._ListFontObj
|
||||
li._Fonts["small"] = fonts["varela12"]
|
||||
li._Fonts["small"] = MyLangManager.TrFont("varela12")
|
||||
|
||||
if self._AList[v]["label"] != "":
|
||||
li.Init( self._AList[v]["label"] )
|
||||
@ -267,7 +266,7 @@ class WifiList(Page):
|
||||
_FootMsg = ["Nav","Info","Scan","Back","Enter"]
|
||||
_EncMethods = None
|
||||
_Scroller = None
|
||||
_ListFontObj = fonts["notosanscjk15"]
|
||||
_ListFontObj = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_InfoPage = None
|
||||
_CurBssid = ""
|
||||
|
||||
@ -7,7 +7,6 @@ import pygame
|
||||
## local UI import
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.lang_manager import MyLangManager
|
||||
# a item for List
|
||||
# - - - - - - - - - - - --
|
||||
|
||||
@ -9,7 +9,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,FileExists
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.scroller import ListScroller
|
||||
|
||||
@ -7,7 +7,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import ICON_TYPES
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.util_funcs import midRect
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
@ -15,12 +15,12 @@ from beeprint import pp
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.icon_item import IconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.skin_manager import MySkinManager
|
||||
from UI.lang_manager import MyLangManager
|
||||
|
||||
from threading import Thread
|
||||
|
||||
@ -79,8 +79,8 @@ class MPDSpectrumPage(Page):
|
||||
_Selector=None
|
||||
_FootMsg = ["Nav","","","Back",""]
|
||||
_MyList = []
|
||||
_ListFont = fonts["veramono12"]
|
||||
_SongFont = fonts["notosanscjk12"]
|
||||
_ListFont = MyLangManager.TrFont("veramono12")
|
||||
_SongFont = MyLangManager.TrFont("notosanscjk12")
|
||||
_PIFI = None
|
||||
_FIFO = None
|
||||
_Color = MySkinManager.GiveColor('Front')
|
||||
|
||||
@ -8,7 +8,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
@ -85,7 +84,7 @@ class MusicLibListPage(Page):
|
||||
_FootMsg = ["Nav","","Scan","Back","Add to Playlist"]
|
||||
_MyList = []
|
||||
_SwapMyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
_MyStack = None
|
||||
|
||||
_Scroller = None
|
||||
|
||||
@ -10,7 +10,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.icon_item import IconItem
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.icon_pool import MyIconPool
|
||||
@ -63,7 +62,7 @@ class PlayListPage(Page):
|
||||
_Selector=None
|
||||
_FootMsg = ["Nav","Remove","RTA","Back","Play/Pause"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
|
||||
_Scroller = None
|
||||
_CurSongTime="0:0"
|
||||
|
||||
@ -6,7 +6,6 @@ from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.simple_name_space import SimpleNamespace
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
@ -19,7 +18,7 @@ class TinyCloudPage(Page):
|
||||
_FootMsg = ["Nav","","","Back",""]
|
||||
_MyList = []
|
||||
|
||||
_ListFontObj = fonts["varela13"]
|
||||
_ListFontObj = MyLangManager.TrFont("varela13")
|
||||
|
||||
_AList = {}
|
||||
_Labels = {}
|
||||
|
||||
@ -27,7 +27,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT,RESTARTUI
|
||||
#from UI.simple_name_space import SimpleNamespace
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.icon_pool import MyIconPool
|
||||
from UI.keys_def import CurKeys
|
||||
|
||||
@ -11,7 +11,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.icon_item import IconItem
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,CmdClean,FileExists
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
@ -94,7 +93,7 @@ class FavListPage(Page):
|
||||
_Selector=None
|
||||
_FootMsg = ["Nav","Remove","Scan","","Run"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.TrFont("notosanscjk15")
|
||||
_MyStack = None
|
||||
_Emulator = None
|
||||
_Parent = None
|
||||
|
||||
@ -8,7 +8,6 @@ import os
|
||||
from UI.constants import ICON_TYPES
|
||||
from UI.page import Page
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.icon_item import IconItem
|
||||
from UI.util_funcs import midRect
|
||||
from UI.skin_manager import MySkinManager
|
||||
|
||||
@ -18,7 +18,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.icon_item import IconItem
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,CmdClean,FileExists
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
@ -101,7 +100,7 @@ class RomListPage(Page):
|
||||
_Selector=None
|
||||
_FootMsg = ["Nav","Del","Scan","Back","Run","AddFav"]
|
||||
_MyList = []
|
||||
_ListFont = fonts["notosanscjk15"]
|
||||
_ListFont = MyLangManager.Tr("notosanscjk15")
|
||||
_MyStack = None
|
||||
_Emulator = None
|
||||
_Parent = None
|
||||
|
||||
@ -15,7 +15,6 @@ from libs.roundrects import aa_round_rect
|
||||
from UI.confirm_page import ConfirmPage
|
||||
from UI.download_process_page import DownloadProcessPage
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.fonts import fonts
|
||||
from UI.multilabel import MultiLabel
|
||||
from UI.lang_manager import MyLangManager
|
||||
|
||||
|
||||
@ -14,10 +14,10 @@ from title_bar import TitleBar
|
||||
from foot_bar import FootBar
|
||||
from constants import Width,Height,bg_color
|
||||
from util_funcs import midRect
|
||||
from fonts import fonts
|
||||
from keys_def import CurKeys
|
||||
from label import Label
|
||||
from skin_manager import MySkinManager
|
||||
from lang_manager import MyLangManager
|
||||
from widget import Widget
|
||||
|
||||
|
||||
@ -28,7 +28,7 @@ class AboveAllPatch(Widget):
|
||||
_Height=120
|
||||
|
||||
_Text =""
|
||||
_FontObj=fonts["veramono20"]
|
||||
_FontObj= MyLangManager.TrFont("veramono20")
|
||||
_Parent =None
|
||||
_Color = MySkinManager.GiveColor('Text')
|
||||
_ValColor = MySkinManager.GiveColor('URL')
|
||||
|
||||
@ -9,7 +9,6 @@ from libs.roundrects import aa_round_rect
|
||||
from constants import Width,Height,ICON_TYPES
|
||||
from page import Page,PageSelector
|
||||
from label import Label
|
||||
from fonts import fonts
|
||||
from util_funcs import midRect
|
||||
from keys_def import CurKeys
|
||||
from skin_manager import MySkinManager
|
||||
|
||||
@ -6,17 +6,18 @@ import commands
|
||||
## local package import
|
||||
from constants import Width,Height,RUNSYS
|
||||
from label import Label
|
||||
from fonts import fonts
|
||||
|
||||
from full_screen import FullScreen
|
||||
from skin_manager import MySkinManager
|
||||
from lang_manager import MyLangManager
|
||||
|
||||
import config
|
||||
|
||||
class CounterScreen(FullScreen):
|
||||
|
||||
_CounterFont = fonts["varela120"]
|
||||
_TextFont1 = fonts["varela15"]
|
||||
_TextFont2 = fonts["varela12"]
|
||||
_CounterFont = MyLangManager.TrFont("varela120")
|
||||
_TextFont1 = MyLangManager.TrFont("varela15")
|
||||
_TextFont2 = MyLangManager.TrFont("varela12")
|
||||
|
||||
_TopLabel = None
|
||||
_BottomLabel = None
|
||||
|
||||
@ -9,7 +9,6 @@ import shutil
|
||||
from constants import Width,Height,ICON_TYPES
|
||||
from page import Page,PageSelector
|
||||
from label import Label
|
||||
from fonts import fonts
|
||||
from util_funcs import midRect
|
||||
from keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from confirm_page import ConfirmPage
|
||||
|
||||
@ -13,7 +13,6 @@ from UI.constants import Width,Height,ICON_TYPES,RUNEVT
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.icon_item import IconItem
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect,CmdClean,FileExists
|
||||
from UI.keys_def import CurKeys, IsKeyMenuOrB
|
||||
from UI.multi_icon_item import MultiIconItem
|
||||
|
||||
@ -1,67 +1,2 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import pygame
|
||||
from pygame.locals import *
|
||||
from sys import exit
|
||||
import os
|
||||
import sys
|
||||
|
||||
import config
|
||||
|
||||
if not pygame.font.get_init():
|
||||
pygame.font.init()
|
||||
|
||||
fonts = {}
|
||||
if not fonts:
|
||||
skinpath = config.SKIN+"/truetype"
|
||||
fonts_path = {}
|
||||
|
||||
fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath
|
||||
fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
|
||||
fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath
|
||||
fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath
|
||||
|
||||
fonts["varela10"] = pygame.font.Font(fonts_path["varela"],10)
|
||||
fonts["varela11"] = pygame.font.Font(fonts_path["varela"],11)
|
||||
fonts["varela12"] = pygame.font.Font(fonts_path["varela"],12)
|
||||
fonts["varela13"] = pygame.font.Font(fonts_path["varela"],13)
|
||||
fonts["varela14"] = pygame.font.Font(fonts_path["varela"],14)
|
||||
fonts["varela15"] = pygame.font.Font(fonts_path["varela"],15)
|
||||
|
||||
fonts["varela16"] = pygame.font.Font(fonts_path["varela"],16)
|
||||
fonts["varela18"] = pygame.font.Font(fonts_path["varela"],18)
|
||||
fonts["varela20"] = pygame.font.Font(fonts_path["varela"],20)
|
||||
fonts["varela22"] = pygame.font.Font(fonts_path["varela"],22)
|
||||
fonts["varela23"] = pygame.font.Font(fonts_path["varela"],23)
|
||||
fonts["varela24"] = pygame.font.Font(fonts_path["varela"],24)
|
||||
fonts["varela25"] = pygame.font.Font(fonts_path["varela"],25)
|
||||
fonts["varela26"] = pygame.font.Font(fonts_path["varela"],26)
|
||||
fonts["varela27"] = pygame.font.Font(fonts_path["varela"],27)
|
||||
fonts["varela28"] = pygame.font.Font(fonts_path["varela"],28)
|
||||
fonts["varela34"] = pygame.font.Font(fonts_path["varela"],34)
|
||||
fonts["varela40"] = pygame.font.Font(fonts_path["varela"],40)
|
||||
fonts["varela120"] = pygame.font.Font(fonts_path["varela"],120)
|
||||
|
||||
fonts["veramono25"] = pygame.font.Font(fonts_path["veramono"],25)
|
||||
fonts["veramono24"] = pygame.font.Font(fonts_path["veramono"],24)
|
||||
fonts["veramono23"] = pygame.font.Font(fonts_path["veramono"],23)
|
||||
fonts["veramono22"] = pygame.font.Font(fonts_path["veramono"],22)
|
||||
fonts["veramono21"] = pygame.font.Font(fonts_path["veramono"],21)
|
||||
fonts["veramono20"] = pygame.font.Font(fonts_path["veramono"],20)
|
||||
fonts["veramono18"] = pygame.font.Font(fonts_path["veramono"],18)
|
||||
fonts["veramono16"] = pygame.font.Font(fonts_path["veramono"],16)
|
||||
fonts["veramono15"] = pygame.font.Font(fonts_path["veramono"],15)
|
||||
fonts["veramono14"] = pygame.font.Font(fonts_path["veramono"],14)
|
||||
fonts["veramono13"] = pygame.font.Font(fonts_path["veramono"],13)
|
||||
fonts["veramono12"] = pygame.font.Font(fonts_path["veramono"],12)
|
||||
fonts["veramono11"] = pygame.font.Font(fonts_path["veramono"],11)
|
||||
fonts["veramono10"] = pygame.font.Font(fonts_path["veramono"],10)
|
||||
|
||||
for i in range(10,28):
|
||||
fonts["notosansmono"+str(i)] = pygame.font.Font(fonts_path["noto"],i)
|
||||
|
||||
for i in range(10,28):
|
||||
fonts["notosanscjk"+str(i)] = pygame.font.Font(fonts_path["notocjk"],i)
|
||||
|
||||
fonts["arial"] = pygame.font.SysFont("arial",16)
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import os
|
||||
from constants import Width,Height,ICON_TYPES,ALIGN
|
||||
from util_funcs import FileExists,midRect
|
||||
from icon_item import IconItem
|
||||
from fonts import fonts
|
||||
from multi_icon_item import MultiIconItem
|
||||
from icon_pool import MyIconPool
|
||||
from libs.roundrects import aa_round_rect
|
||||
|
||||
@ -8,7 +8,6 @@ from libs import easing
|
||||
from UI.constants import Width,Height,ICON_TYPES
|
||||
from UI.page import Page,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.util_funcs import midRect
|
||||
from UI.keys_def import CurKeys, IsKeyStartOrA, IsKeyMenuOrB
|
||||
from UI.icon_item import IconItem
|
||||
@ -108,7 +107,7 @@ class Keyboard(Page):
|
||||
self._Width = self._Screen._Width
|
||||
self._Height = self._Screen._Height
|
||||
|
||||
fontobj = fonts["veramono24"]
|
||||
fontobj = MySkinManager.GiveFont("veramono24")
|
||||
word_margin = 15
|
||||
|
||||
start_x = (self._Width - fontobj.size( "".join(self._Secs[0][0]))[0]-len(self._Secs[0][0])*word_margin)/2+word_margin/2
|
||||
@ -141,7 +140,7 @@ class Keyboard(Page):
|
||||
else:
|
||||
if val == "_S":
|
||||
val = "Space"
|
||||
ti._FontObj = fonts["veramono15"]
|
||||
ti._FontObj = MySkinManager.GiveFont("veramono15")
|
||||
ti._Bold = True
|
||||
|
||||
cur_alpha_size = ti._FontObj.size( val)
|
||||
|
||||
@ -3,8 +3,8 @@ import os
|
||||
import pygame
|
||||
import config
|
||||
import ConfigParser
|
||||
from skin_manager import MySkinManager
|
||||
from util_funcs import FileExists
|
||||
from fonts import fonts
|
||||
|
||||
class CaseConfigParser(ConfigParser.SafeConfigParser):
|
||||
def optionxform(self, optionstr):
|
||||
@ -97,12 +97,12 @@ class LangManager(object):
|
||||
raise Exception('font string format error')
|
||||
|
||||
if "English.ini" in self._ConfigFileName:
|
||||
return fonts[orig_font_str]
|
||||
return MySkinManager.GiveFont(orig_font_str)
|
||||
else:
|
||||
if font_size_number > 28:
|
||||
raise Exception('cjk font string format error '+ str(font_size_number))
|
||||
|
||||
return fonts["notosanscjk"+str(font_size_number)]
|
||||
return MySkinManager.GiveFont("notosanscjk%d" % font_size_number)
|
||||
|
||||
##global MyLangManager Handler
|
||||
MyLangManager = None
|
||||
|
||||
@ -23,6 +23,7 @@ class SkinManager(object):
|
||||
|
||||
_Colors = {}
|
||||
_Config = None
|
||||
_Fonts = {}
|
||||
DefaultSkin = "../skin/default"
|
||||
|
||||
def __init__(self):
|
||||
@ -36,6 +37,38 @@ class SkinManager(object):
|
||||
def Init(self):
|
||||
if not SkinManager._Colors:
|
||||
self.SetColors()
|
||||
if not SkinManager._Fonts:
|
||||
self.SetFonts()
|
||||
|
||||
def SetFonts(self):
|
||||
if not pygame.font.get_init():
|
||||
pygame.font.init()
|
||||
|
||||
skinpath = config.SKIN+"/truetype"
|
||||
fonts_path = {}
|
||||
fonts_path["varela"] = "%s/VarelaRound-Regular.ttf" % skinpath
|
||||
print(fonts_path["varela"])
|
||||
fonts_path["veramono"] = "%s/VeraMono.ttf" % skinpath
|
||||
fonts_path["noto"] = "%s/NotoSansMono-Regular.ttf" % skinpath
|
||||
fonts_path["notocjk"] = "%s/NotoSansCJK-Regular.ttf" % skinpath
|
||||
|
||||
for i in range(10,29):
|
||||
self._Fonts["varela%d"%i] = pygame.font.Font(fonts_path["varela"],i)
|
||||
|
||||
self._Fonts["varela34"] = pygame.font.Font(fonts_path["varela"],34)
|
||||
self._Fonts["varela40"] = pygame.font.Font(fonts_path["varela"],40)
|
||||
self._Fonts["varela120"] = pygame.font.Font(fonts_path["varela"],120)
|
||||
|
||||
for i in range(10,26):
|
||||
self._Fonts["veramono%d"%i] = pygame.font.Font(fonts_path["veramono"],i)
|
||||
|
||||
for i in range(10,28):
|
||||
self._Fonts["notosansmono%d"%i] = pygame.font.Font(fonts_path["noto"],i)
|
||||
|
||||
for i in range(10,28):
|
||||
self._Fonts["notosanscjk%d"%i] = pygame.font.Font(fonts_path["notocjk"],i)
|
||||
|
||||
self._Fonts["arial"] = pygame.font.SysFont("arial",16)
|
||||
|
||||
def SetColors(self):
|
||||
Colors = {}
|
||||
@ -75,6 +108,9 @@ class SkinManager(object):
|
||||
print("error in ConvertToRGB %s" % str(e))
|
||||
continue
|
||||
|
||||
def GiveFont(self,name):
|
||||
return SkinManager._Fonts[name]
|
||||
|
||||
def GiveColor(self,name):
|
||||
if name in SkinManager._Colors:
|
||||
return SkinManager._Colors[name]
|
||||
|
||||
@ -6,7 +6,6 @@ from libs.roundrects import aa_round_rect
|
||||
## local UI import
|
||||
from page import Page,PageStack,PageSelector
|
||||
from label import Label
|
||||
from fonts import fonts
|
||||
from skin_manager import MySkinManager
|
||||
from lang_manager import MyLangManager
|
||||
from widget import Widget
|
||||
|
||||
@ -6,8 +6,8 @@ from libs.roundrects import aa_round_rect
|
||||
## local UI import
|
||||
from UI.page import Page,PageStack,PageSelector
|
||||
from UI.label import Label
|
||||
from UI.fonts import fonts
|
||||
from UI.skin_manager import MySkinManager
|
||||
from UI.lang_manager import MyLangManager
|
||||
from UI.widget import Widget
|
||||
|
||||
class Textarea(Widget):
|
||||
@ -26,7 +26,7 @@ class Textarea(Widget):
|
||||
pass
|
||||
|
||||
def Init(self):
|
||||
self._FontObj = fonts["veramono24"]
|
||||
self._FontObj = MyLangManager.TrFont("veramono24")
|
||||
#pygame.font.Font(fonts_path["veramono"],24)
|
||||
|
||||
def SubTextIndex(self):
|
||||
|
||||
@ -13,7 +13,6 @@ import alsaaudio
|
||||
|
||||
##local import
|
||||
from constants import ICON_TYPES,Width,Height
|
||||
from fonts import fonts
|
||||
from icon_item import IconItem
|
||||
from multi_icon_item import MultiIconItem
|
||||
from icon_pool import MyIconPool
|
||||
@ -300,13 +299,14 @@ class TitleBar(Widget):
|
||||
self._Title = title
|
||||
|
||||
cur_time = datetime.now().strftime("%H:%M")
|
||||
time_text_size = fonts["varela12"].size(cur_time)
|
||||
time_text_font = MySkinManager.GiveFont("varela12")
|
||||
time_text_size = time_text_font.size(cur_time)
|
||||
title_text_size = MyLangManager.TrFont("varela16").size(title)
|
||||
|
||||
self._CanvasHWND.blit(MyLangManager.TrFont("varela16").render(title,True,self._SkinManager.GiveColor("Text")),midRect(title_text_size[0]/2+self._LOffset,
|
||||
title_text_size[1]/2+(self._BarHeight-title_text_size[1])/2,
|
||||
title_text_size[0],title_text_size[1],Width,Height))
|
||||
self._CanvasHWND.blit( fonts["varela12"].render(cur_time,True,self._SkinManager.GiveColor("Text")),midRect(Width-time_text_size[0]/2-self._ROffset,
|
||||
self._CanvasHWND.blit( time_text_font.render(cur_time,True,self._SkinManager.GiveColor("Text")),midRect(Width-time_text_size[0]/2-self._ROffset,
|
||||
time_text_size[1]/2+(self._BarHeight-time_text_size[1])/2,
|
||||
time_text_size[0],time_text_size[1],Width,Height))
|
||||
|
||||
|
||||
@ -12,7 +12,6 @@ import base64
|
||||
from beeprint import pp
|
||||
|
||||
from util_funcs import midRect
|
||||
from fonts import fonts
|
||||
|
||||
from skin_manager import MySkinManager
|
||||
|
||||
@ -28,7 +27,7 @@ class UntitledIcon(object):
|
||||
_Height = 80
|
||||
|
||||
_Words = ["G", "s"]
|
||||
_FontObj = fonts["varela40"]
|
||||
_FontObj = MySkinManager.GiveFont("varela40")
|
||||
|
||||
_BG = None # initial surface
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user