From 28a02230105a173c686cc2996fa47eaca1c1dec3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BB=91=E8=B4=A8?= Date: Thu, 19 Oct 2023 09:49:27 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4=E8=99=9A=E6=8B=9F=E7=BB=88?= =?UTF-8?q?=E7=AB=AF=E8=B4=A6=E5=8F=B7=E8=AE=BE=E7=BD=AE=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E6=BB=B4=E7=AD=94=E6=A1=86=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- OlivOS/nativeWinUIAPI.py | 15 +++++++++++++-- OlivOS/virtualTerminalSDK.py | 3 ++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/OlivOS/nativeWinUIAPI.py b/OlivOS/nativeWinUIAPI.py index 28de21ea..1ae62834 100644 --- a/OlivOS/nativeWinUIAPI.py +++ b/OlivOS/nativeWinUIAPI.py @@ -1998,6 +1998,7 @@ def resFunc(): ) return resFunc + self.init_style() self.root_Checkbutton_init( obj_root='root', obj_name='root_checkbutton_flag_group', @@ -2135,6 +2136,17 @@ def root_Button_init(self, name, text, command, x, y, width, height): height=height ) + def init_style(self): + self.UIData['style'] = ttk.Style(self.UIObject['root']) + self.UIData['style'].configure( + "TCheckbutton", + indicatorbackground=self.UIConfig['color_001'], + indicatorforeground=self.UIConfig['color_004'], + background=self.UIConfig['color_001'], + foreground=self.UIConfig['color_004'] + ) + #self.UIData['style'].map("TCheckbutton", background=[("active", "darkgrey")]) + def root_Checkbutton_init(self, obj_root, obj_name, str_name, x, y, width_t, width, height, action, title=''): self.UIObject[obj_name + '=Label'] = tkinter.Label( self.UIObject[obj_root], @@ -2159,8 +2171,7 @@ def root_Checkbutton_init(self, obj_root, obj_name, str_name, x, y, width_t, wid variable=self.UIData[str_name], onvalue=True, offvalue=False, - - # command=action + style='TCheckbutton' ) # self.UIObject[obj_name].configure( # bg=self.UIConfig['color_001'], diff --git a/OlivOS/virtualTerminalSDK.py b/OlivOS/virtualTerminalSDK.py index f6557deb..60fe3b8b 100644 --- a/OlivOS/virtualTerminalSDK.py +++ b/OlivOS/virtualTerminalSDK.py @@ -125,7 +125,8 @@ def get_Event_from_SDK(target_event): target_event.data.sender['name'] = tmp_user_conf["user_name"] target_event.data.sender['sex'] = 'unknown' target_event.data.sender['age'] = 0 - if tmp_user_conf["flag_group"]: + if tmp_user_conf["flag_group"] \ + and 'unknown' != tmp_user_conf["group_role"]: target_event.data.sender['role'] = tmp_user_conf["group_role"] target_event.data.host_id = None elif target_event.platform['model'] in ['postapi', 'ff14']: