feat(DLPilot): 关于按钮 + 外观默认 System + 校准图案行压缩
This commit is contained in:
@@ -33,6 +33,10 @@ MONO = ('Consolas', 12)
|
||||
BOLD = ('Microsoft YaHei UI', 13, 'bold')
|
||||
TITLE_FONT = ('Microsoft YaHei UI', 18, 'bold')
|
||||
|
||||
APP_NAME = 'DLPilot'
|
||||
APP_VERSION = '0.3.0'
|
||||
REPO_URL = 'https://gitea.hulk.wang/hulk/LT8619C_Debug_Tools'
|
||||
|
||||
|
||||
def get_icon_path():
|
||||
"""工具图标: 源码模式取 logos/ 下, 打包模式取 exe 内嵌资源(_MEIPASS)"""
|
||||
@@ -56,7 +60,7 @@ def _apply_dropdown_theme():
|
||||
|
||||
def run_gui(auto_close=0):
|
||||
"""入口: 配置外观并启动主窗口"""
|
||||
ctk.set_appearance_mode('Dark')
|
||||
ctk.set_appearance_mode('System')
|
||||
_apply_dropdown_theme()
|
||||
App(auto_close).mainloop()
|
||||
|
||||
@@ -134,8 +138,13 @@ class App(ctk.CTk):
|
||||
text_color='gray60').pack(side='left', padx=10, pady=(6, 0))
|
||||
seg = ctk.CTkSegmentedButton(top, values=['Dark', 'Light', 'System'],
|
||||
command=self._set_appearance)
|
||||
seg.set('Dark')
|
||||
seg.set('System')
|
||||
seg.pack(side='right')
|
||||
ctk.CTkButton(top, text='关于', width=48, height=24,
|
||||
fg_color='transparent', border_width=1,
|
||||
border_color=('gray55', 'gray35'),
|
||||
text_color='gray60', hover_color=('gray82', 'gray22'),
|
||||
command=self._show_about).pack(side='right', padx=(0, 12))
|
||||
|
||||
body = ctk.CTkFrame(self, fg_color='transparent')
|
||||
body.pack(fill='both', expand=True, padx=12, pady=(4, 12))
|
||||
@@ -245,16 +254,16 @@ class App(ctk.CTk):
|
||||
row4.pack(fill='x', pady=(6, 0))
|
||||
for i in range(3, config.SLOT_COUNT):
|
||||
cell = ctk.CTkFrame(row4, fg_color='transparent')
|
||||
cell.pack(side='left', padx=(0, 10))
|
||||
btn = ctk.CTkButton(cell, text=self.slots[i]['name'], width=96,
|
||||
cell.pack(side='left', padx=(0, 6))
|
||||
btn = ctk.CTkButton(cell, text=self.slots[i]['name'], width=84,
|
||||
command=lambda i=i: self._show_custom(i))
|
||||
btn.pack(side='left')
|
||||
ctk.CTkButton(cell, text='\uE713', width=30, height=24,
|
||||
ctk.CTkButton(cell, text='\uE713', width=26, height=24,
|
||||
font=('Segoe MDL2 Assets', 13),
|
||||
command=lambda i=i: self._configure_slot(i)
|
||||
).pack(side='left', padx=(4, 0))
|
||||
).pack(side='left', padx=(3, 0))
|
||||
self.slot_buttons.append(btn)
|
||||
ctk.CTkLabel(row4, text='校准图案(预留 5 槽, 齿轮改图)',
|
||||
ctk.CTkLabel(row4, text='校准图案(齿轮改图)',
|
||||
text_color='gray50').pack(side='left', padx=4)
|
||||
|
||||
# -- EDID 原始数据 --
|
||||
@@ -623,6 +632,26 @@ class App(ctk.CTk):
|
||||
ctk.CTkButton(btns, text='取消', width=70, fg_color='gray40',
|
||||
hover_color='gray25', command=dlg.destroy).pack(side='left')
|
||||
|
||||
def _show_about(self):
|
||||
dlg = ctk.CTkToplevel(self)
|
||||
dlg.title(f'关于 {APP_NAME}')
|
||||
dlg.resizable(False, False)
|
||||
dlg.after(150, dlg.grab_set())
|
||||
box = ctk.CTkFrame(dlg, fg_color='transparent')
|
||||
box.pack(padx=26, pady=20)
|
||||
ctk.CTkLabel(box, text=APP_NAME, font=TITLE_FONT, anchor='w').pack(anchor='w')
|
||||
ctk.CTkLabel(box, text=f'v{APP_VERSION} — 3D 光固化光机调试台',
|
||||
text_color='gray60', anchor='w').pack(anchor='w', pady=(0, 12))
|
||||
for line in ('EDID 查看 / 逐字节解析 / 分辨率切换',
|
||||
'测试图案与校准图全屏投屏',
|
||||
'RS485 光机控制: 开关光机 / 光强 / 定时 / 温度 / TEC',
|
||||
'配套硬件: LT8619C → DLPC3421 转接板 (GD32E230 网关)'):
|
||||
ctk.CTkLabel(box, text='· ' + line, anchor='w').pack(anchor='w', pady=1)
|
||||
ctk.CTkLabel(box, text='仓库: ' + REPO_URL, anchor='w',
|
||||
text_color='#3B8ED0').pack(anchor='w', pady=(12, 0))
|
||||
ctk.CTkButton(box, text='关闭', width=84,
|
||||
command=dlg.destroy).pack(anchor='e', pady=(14, 0))
|
||||
|
||||
def _show_edid_fields(self):
|
||||
d = self._cur_display()
|
||||
if d is None:
|
||||
|
||||
Reference in New Issue
Block a user