From aea9534d4de2858a469c779a29f60c2b4f81d2f6 Mon Sep 17 00:00:00 2001 From: cuu Date: Thu, 31 May 2018 15:38:04 +0800 Subject: [PATCH] add socket server thread to receive remote call,and try add skin design on it --- Menu/GameShell/10_Settings/Wifi/__init__.py | 4 -- .../10_Settings/Wifi/icons/__init__.py | 0 .../10_Settings/Wifi/icons/preload.py | 21 --------- Menu/GameShell/10_Settings/Wifi/keyboard.py | 4 +- Menu/GameShell/10_Settings/Wifi/net_item.py | 6 +-- Menu/GameShell/Music Player/__init__.py | 12 ----- Menu/GameShell/Music Player/icons/__init__.py | 0 Menu/GameShell/Music Player/icons/done.png | Bin 198 -> 0 bytes Menu/GameShell/Music Player/icons/preload.py | 21 --------- Menu/GameShell/Music Player/list_item.py | 1 - .../Menu}/GameShell/20_Retro Games/GBA.png | Bin .../Menu}/GameShell/20_Retro Games/MAME.png | Bin .../Menu}/GameShell/20_Retro Games/NES.png | Bin .../default/Menu}/GameShell/CaveStory.png | Bin .../default/Menu}/GameShell/Music Player.png | Bin .../default/Menu}/GameShell/PowerOFF.png | Bin .../default/Menu}/GameShell/Retro Games.png | Bin .../default/Menu}/GameShell/RetroArch.png | Bin .../default/Menu}/GameShell/Settings.png | Bin .../default/Menu}/GameShell/Sleep.png | Bin .../default/Menu}/GameShell/TinyCloud.png | Bin .../default/Menu}/GameShell/freeDM.png | Bin .../default/sys.py}/gameshell/blank.png | Bin .../gameshell/footbar_icons/footbar.png | Bin .../default/sys.py/gameshell}/icons/_L.png | Bin .../default/sys.py/gameshell}/icons/_R.png | Bin .../sys.py}/gameshell/icons/about_bg.png | Bin .../default/sys.py/gameshell}/icons/done.png | Bin .../default/sys.py}/gameshell/icons/empty.png | Bin .../default/sys.py}/gameshell/icons/heart.png | Bin .../sys.py}/gameshell/icons/icon_sd.png | Bin .../default/sys.py}/gameshell/icons/light.png | Bin .../default/sys.py/gameshell}/icons/lock.png | Bin .../sys.py}/gameshell/icons/needwifi_bg.png | Bin .../sys.py}/gameshell/icons/online.png | Bin .../sys.py}/gameshell/icons/rom_download.png | Bin .../sys.py}/gameshell/icons/roundcorners.png | Bin .../default/sys.py}/gameshell/icons/scale.png | Bin .../default/sys.py}/gameshell/icons/star.png | Bin .../default/sys.py}/gameshell/icons/sys.png | Bin .../default/sys.py}/gameshell/icons/vol.png | Bin .../titlebar_icons/battery_unknown.png | Bin .../gameshell/titlebar_icons/soundvolume.png | Bin .../sys.py}/gameshell/titlebar_icons/wifi.png | Bin .../gameshell/titlebar_icons/withcharging.png | Bin .../titlebar_icons/without_charging.png | Bin .../default/truetype}/NotoSansCJK-Regular.ttf | Bin .../truetype}/NotoSansMono-Regular.ttf | Bin .../default/truetype}/VarelaRound-Regular.ttf | Bin .../default/truetype}/VeraMono.ttf | Bin sys.py/UI/.#page.py | 1 + sys.py/UI/fonts.py | 13 +++--- sys.py/UI/foot_bar.py | 4 +- sys.py/UI/icon_pool.py | 4 +- sys.py/UI/main_screen.py | 12 ++--- sys.py/UI/title_bar.py | 11 +---- sys.py/UI/util_funcs.py | 17 +++++++ sys.py/config.py | 4 +- .../ic_battery_charging_full_black.png | Bin 334 -> 0 bytes .../titlebar_icons/ic_volume_up_black.png | Bin 353 -> 0 bytes sys.py/run.py | 42 +++++++++++++++++- 61 files changed, 86 insertions(+), 91 deletions(-) delete mode 100644 Menu/GameShell/10_Settings/Wifi/icons/__init__.py delete mode 100644 Menu/GameShell/10_Settings/Wifi/icons/preload.py delete mode 100644 Menu/GameShell/Music Player/icons/__init__.py delete mode 100644 Menu/GameShell/Music Player/icons/done.png delete mode 100644 Menu/GameShell/Music Player/icons/preload.py rename {Menu => skin/default/Menu}/GameShell/20_Retro Games/GBA.png (100%) rename {Menu => skin/default/Menu}/GameShell/20_Retro Games/MAME.png (100%) rename {Menu => skin/default/Menu}/GameShell/20_Retro Games/NES.png (100%) rename {Menu => skin/default/Menu}/GameShell/CaveStory.png (100%) rename {Menu => skin/default/Menu}/GameShell/Music Player.png (100%) rename {Menu => skin/default/Menu}/GameShell/PowerOFF.png (100%) rename {Menu => skin/default/Menu}/GameShell/Retro Games.png (100%) rename {Menu => skin/default/Menu}/GameShell/RetroArch.png (100%) rename {Menu => skin/default/Menu}/GameShell/Settings.png (100%) rename {Menu => skin/default/Menu}/GameShell/Sleep.png (100%) rename {Menu => skin/default/Menu}/GameShell/TinyCloud.png (100%) rename {Menu => skin/default/Menu}/GameShell/freeDM.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/blank.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/footbar_icons/footbar.png (100%) rename {Menu/GameShell/10_Settings/Wifi => skin/default/sys.py/gameshell}/icons/_L.png (100%) rename {Menu/GameShell/10_Settings/Wifi => skin/default/sys.py/gameshell}/icons/_R.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/about_bg.png (100%) rename {Menu/GameShell/10_Settings/Wifi => skin/default/sys.py/gameshell}/icons/done.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/empty.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/heart.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/icon_sd.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/light.png (100%) rename {Menu/GameShell/10_Settings/Wifi => skin/default/sys.py/gameshell}/icons/lock.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/needwifi_bg.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/online.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/rom_download.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/roundcorners.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/scale.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/star.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/sys.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/icons/vol.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/titlebar_icons/battery_unknown.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/titlebar_icons/soundvolume.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/titlebar_icons/wifi.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/titlebar_icons/withcharging.png (100%) rename {sys.py => skin/default/sys.py}/gameshell/titlebar_icons/without_charging.png (100%) rename {truetype => skin/default/truetype}/NotoSansCJK-Regular.ttf (100%) rename {truetype => skin/default/truetype}/NotoSansMono-Regular.ttf (100%) rename {truetype => skin/default/truetype}/VarelaRound-Regular.ttf (100%) rename {truetype => skin/default/truetype}/VeraMono.ttf (100%) create mode 120000 sys.py/UI/.#page.py delete mode 100644 sys.py/gameshell/titlebar_icons/ic_battery_charging_full_black.png delete mode 100644 sys.py/gameshell/titlebar_icons/ic_volume_up_black.png diff --git a/Menu/GameShell/10_Settings/Wifi/__init__.py b/Menu/GameShell/10_Settings/Wifi/__init__.py index 4341f8e..7d929cf 100644 --- a/Menu/GameShell/10_Settings/Wifi/__init__.py +++ b/Menu/GameShell/10_Settings/Wifi/__init__.py @@ -1,6 +1,5 @@ # -*- coding: utf-8 -*- - ## local UI import import pages import myvars @@ -10,11 +9,8 @@ try: except: print("No icons package") """ -from icons import preload def Init(main_screen): - - preload.load_icons() pages.InitPasswordPage(main_screen) pages.InitScanPage(main_screen) diff --git a/Menu/GameShell/10_Settings/Wifi/icons/__init__.py b/Menu/GameShell/10_Settings/Wifi/icons/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/Menu/GameShell/10_Settings/Wifi/icons/preload.py b/Menu/GameShell/10_Settings/Wifi/icons/preload.py deleted file mode 100644 index b4b0759..0000000 --- a/Menu/GameShell/10_Settings/Wifi/icons/preload.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- - -import pygame -from pygame.locals import * -from sys import exit -import os -import sys - -from beeprint import pp - -ICONS_PRELOAD={} - - -def load_icons(): - basepath = os.path.dirname(os.path.realpath(__file__)) - - files = os.listdir(basepath) - for i in files: - if os.path.isfile(basepath+"/"+i) and i.endswith(".png"): - keyname = i.split(".")[0] - ICONS_PRELOAD[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha() diff --git a/Menu/GameShell/10_Settings/Wifi/keyboard.py b/Menu/GameShell/10_Settings/Wifi/keyboard.py index a6bfca9..8a00c52 100644 --- a/Menu/GameShell/10_Settings/Wifi/keyboard.py +++ b/Menu/GameShell/10_Settings/Wifi/keyboard.py @@ -12,12 +12,12 @@ from UI.fonts import fonts from UI.util_funcs import midRect from UI.keys_def import CurKeys from UI.icon_item import IconItem +from UI.icon_pool import MyIconPool from libs.roundrects import aa_round_rect from textarea import Textarea from text_item import TextItem -from icons import preload import myvars @@ -135,7 +135,7 @@ class Keyboard(Page): if val == "_L" or val == "_R": it = KeyboardIcon() - it._ImgSurf = preload.ICONS_PRELOAD[val] + it._ImgSurf = MyIconPool._Icons[val] it._Parent = self it._Str = val it.Init(start_x+it._ImgSurf.get_width()/2 ,start_y,it._ImgSurf.get_width(),it._ImgSurf.get_height(),0) diff --git a/Menu/GameShell/10_Settings/Wifi/net_item.py b/Menu/GameShell/10_Settings/Wifi/net_item.py index defdc83..765415d 100644 --- a/Menu/GameShell/10_Settings/Wifi/net_item.py +++ b/Menu/GameShell/10_Settings/Wifi/net_item.py @@ -8,8 +8,8 @@ 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 -from icons import preload class NetItemMultiIcon(MultiIconItem): _CanvasHWND = None @@ -140,13 +140,13 @@ class NetItem(object): lock_icon = NetItemIcon() - lock_icon._ImgSurf = preload.ICONS_PRELOAD["lock"] + lock_icon._ImgSurf = MyIconPool._Icons["lock"] lock_icon._CanvasHWND = self._Parent._CanvasHWND lock_icon._Parent = self self._Icons["lock"] = lock_icon done_icon = NetItemIcon() - done_icon._ImgSurf = preload.ICONS_PRELOAD["done"] + done_icon._ImgSurf = MyIconPool._Icons["done"] done_icon._CanvasHWND = self._Parent._CanvasHWND done_icon._Parent = self diff --git a/Menu/GameShell/Music Player/__init__.py b/Menu/GameShell/Music Player/__init__.py index 381cbc8..86c5bfe 100644 --- a/Menu/GameShell/Music Player/__init__.py +++ b/Menu/GameShell/Music Player/__init__.py @@ -1,26 +1,14 @@ # -*- coding: utf-8 -*- import pygame -from pygame.locals import * -from sys import exit -import os -import sys - -from datetime import datetime - -import base64 -from beeprint import pp - ## local UI import import pages import myvars -from icons import preload def Init(main_screen): pages.InitPoller() - preload.load_icons() pages.InitListPage(main_screen) pages.InitMusicLibPage(main_screen) pages.InitSpectrumPage(main_screen) diff --git a/Menu/GameShell/Music Player/icons/__init__.py b/Menu/GameShell/Music Player/icons/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/Menu/GameShell/Music Player/icons/done.png b/Menu/GameShell/Music Player/icons/done.png deleted file mode 100644 index ceeadbf8a0767c544fe2978ce54e740741886be1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 198 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@RheUQZXt5R2Zkmwow~6$IKIieHXf zw*BI+7lqHvd~Fu#*qPr5_`}&F?HOTMdB~inV7KbaOKfqI);S*Fa5-R=KS|&aM@?h9 zbyS%!OJUON!?mVEGc4(rULdfsKv-Q#V_LR*z*^_n)sT4&2i{vFs*m wSnr#CQEj2hlQ^=EcYoY&^0n+=;JZCy&kY%#TO8T61?VsaPgg&ebxsLQ0E|^l!2kdN diff --git a/Menu/GameShell/Music Player/icons/preload.py b/Menu/GameShell/Music Player/icons/preload.py deleted file mode 100644 index b4b0759..0000000 --- a/Menu/GameShell/Music Player/icons/preload.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- - -import pygame -from pygame.locals import * -from sys import exit -import os -import sys - -from beeprint import pp - -ICONS_PRELOAD={} - - -def load_icons(): - basepath = os.path.dirname(os.path.realpath(__file__)) - - files = os.listdir(basepath) - for i in files: - if os.path.isfile(basepath+"/"+i) and i.endswith(".png"): - keyname = i.split(".")[0] - ICONS_PRELOAD[keyname] = pygame.image.load(basepath+"/"+i).convert_alpha() diff --git a/Menu/GameShell/Music Player/list_item.py b/Menu/GameShell/Music Player/list_item.py index 2d2c369..e3fe554 100644 --- a/Menu/GameShell/Music Player/list_item.py +++ b/Menu/GameShell/Music Player/list_item.py @@ -17,7 +17,6 @@ from UI.util_funcs import midRect # ------------------------ import myvars # icons_path -from icons import preload class ListItemIcon(IconItem): diff --git a/Menu/GameShell/20_Retro Games/GBA.png b/skin/default/Menu/GameShell/20_Retro Games/GBA.png similarity index 100% rename from Menu/GameShell/20_Retro Games/GBA.png rename to skin/default/Menu/GameShell/20_Retro Games/GBA.png diff --git a/Menu/GameShell/20_Retro Games/MAME.png b/skin/default/Menu/GameShell/20_Retro Games/MAME.png similarity index 100% rename from Menu/GameShell/20_Retro Games/MAME.png rename to skin/default/Menu/GameShell/20_Retro Games/MAME.png diff --git a/Menu/GameShell/20_Retro Games/NES.png b/skin/default/Menu/GameShell/20_Retro Games/NES.png similarity index 100% rename from Menu/GameShell/20_Retro Games/NES.png rename to skin/default/Menu/GameShell/20_Retro Games/NES.png diff --git a/Menu/GameShell/CaveStory.png b/skin/default/Menu/GameShell/CaveStory.png similarity index 100% rename from Menu/GameShell/CaveStory.png rename to skin/default/Menu/GameShell/CaveStory.png diff --git a/Menu/GameShell/Music Player.png b/skin/default/Menu/GameShell/Music Player.png similarity index 100% rename from Menu/GameShell/Music Player.png rename to skin/default/Menu/GameShell/Music Player.png diff --git a/Menu/GameShell/PowerOFF.png b/skin/default/Menu/GameShell/PowerOFF.png similarity index 100% rename from Menu/GameShell/PowerOFF.png rename to skin/default/Menu/GameShell/PowerOFF.png diff --git a/Menu/GameShell/Retro Games.png b/skin/default/Menu/GameShell/Retro Games.png similarity index 100% rename from Menu/GameShell/Retro Games.png rename to skin/default/Menu/GameShell/Retro Games.png diff --git a/Menu/GameShell/RetroArch.png b/skin/default/Menu/GameShell/RetroArch.png similarity index 100% rename from Menu/GameShell/RetroArch.png rename to skin/default/Menu/GameShell/RetroArch.png diff --git a/Menu/GameShell/Settings.png b/skin/default/Menu/GameShell/Settings.png similarity index 100% rename from Menu/GameShell/Settings.png rename to skin/default/Menu/GameShell/Settings.png diff --git a/Menu/GameShell/Sleep.png b/skin/default/Menu/GameShell/Sleep.png similarity index 100% rename from Menu/GameShell/Sleep.png rename to skin/default/Menu/GameShell/Sleep.png diff --git a/Menu/GameShell/TinyCloud.png b/skin/default/Menu/GameShell/TinyCloud.png similarity index 100% rename from Menu/GameShell/TinyCloud.png rename to skin/default/Menu/GameShell/TinyCloud.png diff --git a/Menu/GameShell/freeDM.png b/skin/default/Menu/GameShell/freeDM.png similarity index 100% rename from Menu/GameShell/freeDM.png rename to skin/default/Menu/GameShell/freeDM.png diff --git a/sys.py/gameshell/blank.png b/skin/default/sys.py/gameshell/blank.png similarity index 100% rename from sys.py/gameshell/blank.png rename to skin/default/sys.py/gameshell/blank.png diff --git a/sys.py/gameshell/footbar_icons/footbar.png b/skin/default/sys.py/gameshell/footbar_icons/footbar.png similarity index 100% rename from sys.py/gameshell/footbar_icons/footbar.png rename to skin/default/sys.py/gameshell/footbar_icons/footbar.png diff --git a/Menu/GameShell/10_Settings/Wifi/icons/_L.png b/skin/default/sys.py/gameshell/icons/_L.png similarity index 100% rename from Menu/GameShell/10_Settings/Wifi/icons/_L.png rename to skin/default/sys.py/gameshell/icons/_L.png diff --git a/Menu/GameShell/10_Settings/Wifi/icons/_R.png b/skin/default/sys.py/gameshell/icons/_R.png similarity index 100% rename from Menu/GameShell/10_Settings/Wifi/icons/_R.png rename to skin/default/sys.py/gameshell/icons/_R.png diff --git a/sys.py/gameshell/icons/about_bg.png b/skin/default/sys.py/gameshell/icons/about_bg.png similarity index 100% rename from sys.py/gameshell/icons/about_bg.png rename to skin/default/sys.py/gameshell/icons/about_bg.png diff --git a/Menu/GameShell/10_Settings/Wifi/icons/done.png b/skin/default/sys.py/gameshell/icons/done.png similarity index 100% rename from Menu/GameShell/10_Settings/Wifi/icons/done.png rename to skin/default/sys.py/gameshell/icons/done.png diff --git a/sys.py/gameshell/icons/empty.png b/skin/default/sys.py/gameshell/icons/empty.png similarity index 100% rename from sys.py/gameshell/icons/empty.png rename to skin/default/sys.py/gameshell/icons/empty.png diff --git a/sys.py/gameshell/icons/heart.png b/skin/default/sys.py/gameshell/icons/heart.png similarity index 100% rename from sys.py/gameshell/icons/heart.png rename to skin/default/sys.py/gameshell/icons/heart.png diff --git a/sys.py/gameshell/icons/icon_sd.png b/skin/default/sys.py/gameshell/icons/icon_sd.png similarity index 100% rename from sys.py/gameshell/icons/icon_sd.png rename to skin/default/sys.py/gameshell/icons/icon_sd.png diff --git a/sys.py/gameshell/icons/light.png b/skin/default/sys.py/gameshell/icons/light.png similarity index 100% rename from sys.py/gameshell/icons/light.png rename to skin/default/sys.py/gameshell/icons/light.png diff --git a/Menu/GameShell/10_Settings/Wifi/icons/lock.png b/skin/default/sys.py/gameshell/icons/lock.png similarity index 100% rename from Menu/GameShell/10_Settings/Wifi/icons/lock.png rename to skin/default/sys.py/gameshell/icons/lock.png diff --git a/sys.py/gameshell/icons/needwifi_bg.png b/skin/default/sys.py/gameshell/icons/needwifi_bg.png similarity index 100% rename from sys.py/gameshell/icons/needwifi_bg.png rename to skin/default/sys.py/gameshell/icons/needwifi_bg.png diff --git a/sys.py/gameshell/icons/online.png b/skin/default/sys.py/gameshell/icons/online.png similarity index 100% rename from sys.py/gameshell/icons/online.png rename to skin/default/sys.py/gameshell/icons/online.png diff --git a/sys.py/gameshell/icons/rom_download.png b/skin/default/sys.py/gameshell/icons/rom_download.png similarity index 100% rename from sys.py/gameshell/icons/rom_download.png rename to skin/default/sys.py/gameshell/icons/rom_download.png diff --git a/sys.py/gameshell/icons/roundcorners.png b/skin/default/sys.py/gameshell/icons/roundcorners.png similarity index 100% rename from sys.py/gameshell/icons/roundcorners.png rename to skin/default/sys.py/gameshell/icons/roundcorners.png diff --git a/sys.py/gameshell/icons/scale.png b/skin/default/sys.py/gameshell/icons/scale.png similarity index 100% rename from sys.py/gameshell/icons/scale.png rename to skin/default/sys.py/gameshell/icons/scale.png diff --git a/sys.py/gameshell/icons/star.png b/skin/default/sys.py/gameshell/icons/star.png similarity index 100% rename from sys.py/gameshell/icons/star.png rename to skin/default/sys.py/gameshell/icons/star.png diff --git a/sys.py/gameshell/icons/sys.png b/skin/default/sys.py/gameshell/icons/sys.png similarity index 100% rename from sys.py/gameshell/icons/sys.png rename to skin/default/sys.py/gameshell/icons/sys.png diff --git a/sys.py/gameshell/icons/vol.png b/skin/default/sys.py/gameshell/icons/vol.png similarity index 100% rename from sys.py/gameshell/icons/vol.png rename to skin/default/sys.py/gameshell/icons/vol.png diff --git a/sys.py/gameshell/titlebar_icons/battery_unknown.png b/skin/default/sys.py/gameshell/titlebar_icons/battery_unknown.png similarity index 100% rename from sys.py/gameshell/titlebar_icons/battery_unknown.png rename to skin/default/sys.py/gameshell/titlebar_icons/battery_unknown.png diff --git a/sys.py/gameshell/titlebar_icons/soundvolume.png b/skin/default/sys.py/gameshell/titlebar_icons/soundvolume.png similarity index 100% rename from sys.py/gameshell/titlebar_icons/soundvolume.png rename to skin/default/sys.py/gameshell/titlebar_icons/soundvolume.png diff --git a/sys.py/gameshell/titlebar_icons/wifi.png b/skin/default/sys.py/gameshell/titlebar_icons/wifi.png similarity index 100% rename from sys.py/gameshell/titlebar_icons/wifi.png rename to skin/default/sys.py/gameshell/titlebar_icons/wifi.png diff --git a/sys.py/gameshell/titlebar_icons/withcharging.png b/skin/default/sys.py/gameshell/titlebar_icons/withcharging.png similarity index 100% rename from sys.py/gameshell/titlebar_icons/withcharging.png rename to skin/default/sys.py/gameshell/titlebar_icons/withcharging.png diff --git a/sys.py/gameshell/titlebar_icons/without_charging.png b/skin/default/sys.py/gameshell/titlebar_icons/without_charging.png similarity index 100% rename from sys.py/gameshell/titlebar_icons/without_charging.png rename to skin/default/sys.py/gameshell/titlebar_icons/without_charging.png diff --git a/truetype/NotoSansCJK-Regular.ttf b/skin/default/truetype/NotoSansCJK-Regular.ttf similarity index 100% rename from truetype/NotoSansCJK-Regular.ttf rename to skin/default/truetype/NotoSansCJK-Regular.ttf diff --git a/truetype/NotoSansMono-Regular.ttf b/skin/default/truetype/NotoSansMono-Regular.ttf similarity index 100% rename from truetype/NotoSansMono-Regular.ttf rename to skin/default/truetype/NotoSansMono-Regular.ttf diff --git a/truetype/VarelaRound-Regular.ttf b/skin/default/truetype/VarelaRound-Regular.ttf similarity index 100% rename from truetype/VarelaRound-Regular.ttf rename to skin/default/truetype/VarelaRound-Regular.ttf diff --git a/truetype/VeraMono.ttf b/skin/default/truetype/VeraMono.ttf similarity index 100% rename from truetype/VeraMono.ttf rename to skin/default/truetype/VeraMono.ttf diff --git a/sys.py/UI/.#page.py b/sys.py/UI/.#page.py new file mode 120000 index 0000000..c042f4f --- /dev/null +++ b/sys.py/UI/.#page.py @@ -0,0 +1 @@ +guu@guu-desktop.5528:1527716105 \ No newline at end of file diff --git a/sys.py/UI/fonts.py b/sys.py/UI/fonts.py index fbcf3e4..29d5e19 100644 --- a/sys.py/UI/fonts.py +++ b/sys.py/UI/fonts.py @@ -6,18 +6,19 @@ from sys import exit import os import sys -from datetime import datetime - +import config if not pygame.font.get_init(): pygame.font.init() + +skinpath = "../skin/"+config.SKIN+"/truetype" fonts_path = {} -fonts_path["varela"] = "../truetype/VarelaRound-Regular.ttf" -fonts_path["veramono"] = "../truetype/VeraMono.ttf" -fonts_path["noto"] = "../truetype/NotoSansMono-Regular.ttf" -fonts_path["notocjk"] = "../truetype/NotoSansCJK-Regular.ttf" +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 = {} fonts["varela12"] = pygame.font.Font(fonts_path["varela"],12) diff --git a/sys.py/UI/foot_bar.py b/sys.py/UI/foot_bar.py index 19f4381..2eec276 100644 --- a/sys.py/UI/foot_bar.py +++ b/sys.py/UI/foot_bar.py @@ -6,14 +6,14 @@ import os ##local import from constants import Width,Height,ICON_TYPES,ALIGN -from util_funcs import FileExists,midRect +from util_funcs import FileExists,midRect,SkinMap 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 -icon_base_path = "gameshell/footbar_icons/" +icon_base_path = SkinMap("gameshell/footbar_icons/") class FootBarIcon(MultiIconItem): diff --git a/sys.py/UI/icon_pool.py b/sys.py/UI/icon_pool.py index 17b7412..f08058c 100644 --- a/sys.py/UI/icon_pool.py +++ b/sys.py/UI/icon_pool.py @@ -6,12 +6,12 @@ from sys import exit import os import sys - +from util_funcs import SkinMap ##pool only store surfaces class IconPool(object): - _GameShellIconPath = "gameshell/icons/" + _GameShellIconPath = SkinMap("gameshell/icons/") _Icons = {} def __init__(self): self._Icons= {} diff --git a/sys.py/UI/main_screen.py b/sys.py/UI/main_screen.py index eb1ff5f..69e6aef 100644 --- a/sys.py/UI/main_screen.py +++ b/sys.py/UI/main_screen.py @@ -19,7 +19,7 @@ from page import Page,PageStack from title_bar import TitleBar from foot_bar import FootBar from constants import Width,Height,bg_color -from util_funcs import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable +from util_funcs import midRect,FileExists,ReplaceSuffix,ReadTheFileContent,CmdClean,MakeExecutable,SkinMap from fonts import fonts from keys_def import CurKeys from label import Label @@ -353,7 +353,7 @@ class MainScreen(object): return False def ReadTheDirIntoPages(self,_dir,pglevel,cur_page): - + if FileExists(_dir) == False and os.path.isdir(_dir) == False: return @@ -371,8 +371,8 @@ class MainScreen(object): iconitem = IconItem() iconitem._CmdPath = "" iconitem.AddLabel(i2,self._IconFont) - if FileExists(_dir+"/"+i2+".png"): - iconitem._ImageName = _dir+"/"+i2+".png" + if FileExists( SkinMap(_dir+"/"+i2+".png") ): + iconitem._ImageName = SkinMap(_dir+"/"+i2+".png") else: untitled = UntitledIcon() untitled.Init() @@ -446,8 +446,8 @@ class MainScreen(object): iconitem._CmdPath = _dir+"/"+i MakeExecutable(iconitem._CmdPath) iconitem._MyType = ICON_TYPES["EXE"] - if FileExists(_dir+"/"+ReplaceSuffix(i2,"png")): - iconitem._ImageName = _dir+"/"+ReplaceSuffix(i2,"png") + if FileExists( SkinMap( _dir+"/"+ReplaceSuffix(i2,"png"))): + iconitem._ImageName = SkinMap(_dir+"/"+ReplaceSuffix(i2,"png")) else: untitled = UntitledIcon() untitled.Init() diff --git a/sys.py/UI/title_bar.py b/sys.py/UI/title_bar.py index 080d425..95c2c59 100644 --- a/sys.py/UI/title_bar.py +++ b/sys.py/UI/title_bar.py @@ -17,7 +17,7 @@ from icon_item import IconItem from multi_icon_item import MultiIconItem from icon_pool import MyIconPool -from util_funcs import midRect,SwapAndShow +from util_funcs import midRect,SwapAndShow,SkinMap from config import Battery @@ -25,7 +25,7 @@ from libs.roundrects import aa_round_rect from libs.DBUS import is_wifi_connected_now,wifi_strength -icon_base_path = "gameshell/titlebar_icons/" +icon_base_path = SkinMap("gameshell/titlebar_icons/") class TitleBar: _PosX = 0 _PosY = 0 @@ -179,13 +179,6 @@ class TitleBar: self._CanvasHWND = pygame.Surface((self._Width,self._Height)) self._HWND = screen - icon_snd = IconItem() - icon_snd._MyType = ICON_TYPES["STAT"] - icon_snd._Parent = self - icon_snd._ImageName = icon_base_path+"ic_volume_up_black.png" - icon_snd.Adjust(start_x,self._icon_height/2+(self._BarHeight-self._icon_height)/2,self._icon_width,self._icon_height,0) - icon_snd.ChangeImgSurfColor(self._IconColor) - icon_wifi_status = MultiIconItem() icon_wifi_status._MyType = ICON_TYPES["STAT"] diff --git a/sys.py/UI/util_funcs.py b/sys.py/UI/util_funcs.py index a15d523..eb72203 100644 --- a/sys.py/UI/util_funcs.py +++ b/sys.py/UI/util_funcs.py @@ -11,7 +11,24 @@ import subprocess #from beeprint import pp import string from Xlib import X,display +import config +def SkinMap(orig_file_or_dir): + DefaultSkin = "default" + + if orig_file_or_dir.startswith(".."): + ret = orig_file_or_dir.replace("..","../skin/"+config.SKIN) + if FileExists(ret) == False: + ret = orig_file_or_dir.replace("..","../skin/"+DefaultSkin) + else: + ret = "../skin/"+config.SKIN+"/sys.py/"+orig_file_or_dir + if FileExists(ret) == False: + ret = "../skin/"+DefaultSkin+"/sys.py/"+orig_file_or_dir + + if FileExists( ret ): + return ret + else: ## if not existed both in default or custom skin ,return where it is + return orig_file_or_dir def get_git_revision_hash(): return subprocess.check_output(['git', 'rev-parse', 'HEAD']) diff --git a/sys.py/config.py b/sys.py/config.py index 363b18e..5e40c83 100644 --- a/sys.py/config.py +++ b/sys.py/config.py @@ -12,4 +12,6 @@ MPD_socket = "/tmp/mpd.socket" UPDATE_URL="https://raw.githubusercontent.com/clockworkpi/CPI/master/launcher_ver.json" -VERSION="1.0" +VERSION="stable 1.0" + +SKIN="default" diff --git a/sys.py/gameshell/titlebar_icons/ic_battery_charging_full_black.png b/sys.py/gameshell/titlebar_icons/ic_battery_charging_full_black.png deleted file mode 100644 index 10561e6cd65536e443ec8492290331469e518df8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 334 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mSQK*5Dp-y;YjHK@;M7UB8!3Q zuY)k7lg8`{prB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt-oLT^vI! zde>gs=*Q$JaO|Tz3%Apom$jVCVq$jOowBS;kBSQUWK^ylzi8fv+k0|D~7ZiX$rebs zeppYpIOrXvzuM|lR?Fs1jS>O;<_i}}T#)#?Yr%S-y3k9vR|hl9dSJQyfA8-JyWM`V Y)=H>mtbVbg5a=xiPgg&ebxsLQ0FJAHU;qFB diff --git a/sys.py/gameshell/titlebar_icons/ic_volume_up_black.png b/sys.py/gameshell/titlebar_icons/ic_volume_up_black.png deleted file mode 100644 index b1a5d343a55025b83177fa9d55e9fe359a5c2621..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 353 zcmeAS@N?(olHy`uVBq!ia0vp^LLkh+1|-AI^@Rf|mSQK*5Dp-y;YjHK@;M7UB8!3Q zuY)k7lg8`{prB-lYeY$Kep*R+Vo@qXd3m{BW?pu2a$-TMUVc&f>~}U&Kt=aFT^vI! zde2_k>*eey(DsnMp39Z{@~ViJyb+onOlsv1a&LI})J93KKN=Uf-dXysselfXndipp zl*qmUGp7&Dt%-H_WYgOIFT2`wM~?5qJ&~A9#uY*rjO8|lUpT;@BKB4{=Am}k)_AU& zssDt1lG1yv-0b(wW(jK6E0lZt`o(**#(A3_$%H%dEV(9P>eg5U&`qh3*;}e5Jj(o}P r`C@zCiB$F94f0r}ckUlk#JXo&Jq=fG{VFd5^eKa