3838StyleColorTemplate = """
3939/*主窗口*/
4040#widgetMain {{
41- background-color : rgba({0}, {1}, {2}, 255);
41+ background: rgba({0}, {1}, {2}, 255);
4242}}
4343
4444/*搜索框中的按钮*/
145145StyleGradientTemplate = """
146146/*主窗口*/
147147#widgetMain {{
148- background-color : {3};
148+ background: {3};
149149}}
150150
151151/*搜索框中的按钮*/
@@ -305,9 +305,8 @@ def loadColourfulTheme(cls, color, widget=None):
305305 :param color: 背景颜色
306306 :param widget: 指定控件
307307 """
308- ThemeManager .ThemeName = 'Default'
309308 # 加载主题取样式
310- path = cls .stylePath ()
309+ path = cls .stylePath ('Default' )
311310 AppLog .info ('stylePath: {}' .format (path ))
312311 try :
313312 styleSheet = open (path , 'rb' ).read ().decode (
@@ -330,9 +329,8 @@ def loadPictureTheme(cls, image=None, widget=None):
330329 :param image: 背景图片
331330 :param widget: 指定控件
332331 """
333- ThemeManager .ThemeName = Setting .value ('theme' , 'Default' , str )
334332 # 加载主题取样式
335- path = cls .stylePath ()
333+ path = cls .stylePath ('Default' )
336334 AppLog .info ('stylePath: {}' .format (path ))
337335 try :
338336 styleSheet = open (path , 'rb' ).read ().decode (
@@ -393,9 +391,9 @@ def fontPath(cls):
393391 return os .path .abspath (os .path .join (ThemeManager .ThemeDir , ThemeManager .ThemeName , 'font.ttf' )).replace ('\\ ' , '/' )
394392
395393 @classmethod
396- def stylePath (cls ):
394+ def stylePath (cls , path = '' ):
397395 """
398396 :param cls:
399397 :return: 主题中 style.qss 的绝对路径
400398 """
401- return os .path .abspath (os .path .join (ThemeManager .ThemeDir , ThemeManager .ThemeName , 'style.qss' )).replace ('\\ ' , '/' )
399+ return os .path .abspath (os .path .join (ThemeManager .ThemeDir , path or ThemeManager .ThemeName , 'style.qss' )).replace ('\\ ' , '/' )
0 commit comments