diff --git a/docs/changes.md b/docs/changes.md index 659a3ed8e..4a7e67726 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -2,6 +2,7 @@ 2022/04/14 * 让 windows 的串口也支持 select 的形式(感谢智明提供补丁)。 + * 还原 app_helper_base.py 脚本的修改(感谢智明提供补丁)。 2022/04/13 * 复切换主题时,销毁style后,由于控件need_update_style为false,没有通知该控件style更新数据,导致获取该控件样式属性时发生崩溃问题(感谢兆坤提供补丁)。 diff --git a/scripts/app_helper_base.py b/scripts/app_helper_base.py index 5e7b309c4..b88618573 100644 --- a/scripts/app_helper_base.py +++ b/scripts/app_helper_base.py @@ -46,6 +46,11 @@ def get_project_w(info, theme): def get_project_h(info, theme): return info['assets']['themes'][theme]['lcd']['height'] +def get_project_lcd_orientation(info, theme): + if 'orientation' in info['assets']['themes'][theme]['lcd'] : + return info['assets']['themes'][theme]['lcd']['orientation'] + else : + return '0' def get_project_theme(info): return info['assets']['activedTheme'] @@ -353,6 +358,7 @@ class AppHelperBase: APP_THEME = 'default' LCD_WIDTH = '320' LCD_HEIGHT = '480' + LCD_ORIENTATION = '0' APP_DEFAULT_FONT = 'default' APP_DEFAULT_LANGUAGE = 'zh' APP_DEFAULT_COUNTRY = 'CN' @@ -365,6 +371,7 @@ class AppHelperBase: APP_DEFAULT_LANGUAGE = get_project_language(config) APP_DEFAULT_COUNTRY = get_project_country(config) APP_RES_ROOT = get_project_res_root(config) + LCD_ORIENTATION = get_project_lcd_orientation(config, APP_THEME) if ARGUMENTS.get('HELP', ''): self.showHelp() @@ -407,6 +414,11 @@ class AppHelperBase: if len(IDL_DEF) > 0: self.GEN_IDL_DEF = not IDL_DEF.lower().startswith('f') + if LCD_ORIENTATION == '90' or LCD_ORIENTATION == '270' : + tmp = LCD_WIDTH; + LCD_WIDTH = LCD_HEIGHT; + LCD_HEIGHT = tmp; + APP_CCFLAGS = ' -DLCD_WIDTH=' + LCD_WIDTH + ' -DLCD_HEIGHT=' + LCD_HEIGHT + ' ' APP_CCFLAGS = APP_CCFLAGS + ' -DAPP_DEFAULT_FONT=\\\"' + APP_DEFAULT_FONT + '\\\" ' APP_CCFLAGS = APP_CCFLAGS + ' -DAPP_THEME=\\\"' + APP_THEME + '\\\" ' @@ -435,7 +447,10 @@ class AppHelperBase: self.APP_TOOLS = [awtk.TOOLS_NAME] os.environ['BUILD_SHARED'] = str(self.isBuildShared()) - print(LCD_WIDTH, LCD_HEIGHT) + if LCD_ORIENTATION == '90' or LCD_ORIENTATION == '270' : + print(LCD_WIDTH, LCD_HEIGHT, "orentation_" + LCD_ORIENTATION) + else : + print(LCD_HEIGHT, LCD_WIDTH, "orentation_" + LCD_ORIENTATION) def prepare(self): if self.GEN_IDL_DEF and not self.LINUX_FB: