style: polish dashboard wifi adb ui
This commit is contained in:
1 parent
9a75b9b481
commit
5aeeef4aee
2 files changed
+210
-95
No files matched your search
@@ -17,6 +17,8 @@ from tkinter import ttk
|
||||
from tkinter.constants import LEFT, W, X
|
||||
from typing import Callable
|
||||
|
||||
from gui.dashboard_app import theme
|
||||
from gui.dashboard_app.widgets import button, rounded_surface
|
||||
from gui.gui_core import (
|
||||
auto_connect_wifi_adb,
|
||||
connect_wifi_adb,
|
||||
@@ -35,6 +37,60 @@ from gui.gui_core_pkg.wifi_adb_scan import query_device_model
|
||||
from gui.components.wifi_adb_scan_dialog import open_scan_dialog
|
||||
|
||||
|
||||
TITLE_FONT = ("Microsoft YaHei UI", 20, "bold")
|
||||
SUBTITLE_FONT = ("Microsoft YaHei UI", 12)
|
||||
LABEL_FONT = ("Microsoft YaHei UI", 13, "bold")
|
||||
BODY_FONT = ("Microsoft YaHei UI", 13)
|
||||
HELP_FONT = ("Microsoft YaHei UI", 12)
|
||||
|
||||
|
||||
def _setup_wifi_dialog_styles(dialog: tk.Toplevel) -> None:
|
||||
style = ttk.Style(dialog)
|
||||
style.configure("WifiADB.TCombobox", padding=(10, 8), font=BODY_FONT)
|
||||
style.configure("WifiADB.TEntry", padding=(10, 8), font=BODY_FONT)
|
||||
|
||||
|
||||
def _card(parent: tk.Misc, title: str, subtitle: str = "") -> tuple[tk.Frame, tk.Frame]:
|
||||
outer = rounded_surface(parent, fill=theme.SURFACE, outline=theme.BORDER, radius=theme.RADIUS_MD)
|
||||
head = tk.Frame(outer, bg=theme.SURFACE)
|
||||
head.pack(fill="x", padx=22, pady=(18, 10))
|
||||
tk.Label(head, text=title, bg=theme.SURFACE, fg=theme.TEXT, font=("Microsoft YaHei UI", 15, "bold")).pack(side="left")
|
||||
if subtitle:
|
||||
tk.Label(head, text=subtitle, bg=theme.SURFACE, fg=theme.SUBTLE, font=theme.FONT_SMALL).pack(side="left", padx=(12, 0))
|
||||
body = tk.Frame(outer, bg=theme.SURFACE)
|
||||
body.pack(fill="both", expand=True, padx=22, pady=(0, 20))
|
||||
return outer, body
|
||||
|
||||
|
||||
def _status_pill(parent: tk.Misc, text: str, *, ok: bool, active: bool = True) -> tk.Label:
|
||||
if ok:
|
||||
fg, bg = theme.GREEN, theme.GREEN_SOFT
|
||||
elif active:
|
||||
fg, bg = theme.AMBER, theme.AMBER_SOFT
|
||||
else:
|
||||
fg, bg = theme.MUTED, theme.SURFACE_ALT
|
||||
return tk.Label(parent, text=text, bg=bg, fg=fg, font=("Microsoft YaHei UI", 12, "bold"), padx=12, pady=5)
|
||||
|
||||
|
||||
def _field_group(parent: tk.Misc, title: str) -> tk.Frame:
|
||||
box = tk.Frame(parent, bg=theme.SURFACE_ALT, highlightthickness=1, highlightbackground=theme.BORDER)
|
||||
tk.Label(box, text=title, bg=theme.SURFACE_ALT, fg=theme.TEXT, font=LABEL_FONT).pack(anchor="w", padx=14, pady=(12, 8))
|
||||
return box
|
||||
|
||||
|
||||
def _action_grid(parent: tk.Misc, actions: tuple[tuple[str, Callable[[], None], str, int], ...], *, columns: int = 3) -> None:
|
||||
for col in range(columns):
|
||||
parent.grid_columnconfigure(col, weight=1, uniform="action")
|
||||
for idx, (text, command, kind, width) in enumerate(actions):
|
||||
button(parent, text, command, kind=kind, width=width).grid(
|
||||
row=idx // columns,
|
||||
column=idx % columns,
|
||||
sticky="ew",
|
||||
padx=(0 if idx % columns == 0 else 10, 0),
|
||||
pady=4,
|
||||
)
|
||||
|
||||
|
||||
def open_wifi_adb_dialog(
|
||||
parent: tk.Misc,
|
||||
*,
|
||||
@@ -45,36 +101,66 @@ def open_wifi_adb_dialog(
|
||||
"""打开WiFi ADB设置对话框"""
|
||||
dialog = tk.Toplevel(parent)
|
||||
dialog.title("WiFi ADB 设置")
|
||||
dialog.geometry("500x450")
|
||||
dialog.geometry("900x820")
|
||||
dialog.configure(bg=theme.BG)
|
||||
_setup_wifi_dialog_styles(dialog)
|
||||
# 允许用户调整对话框大小,避免窗口内容被裁剪
|
||||
dialog.resizable(True, True)
|
||||
dialog.minsize(420, 320)
|
||||
dialog.minsize(780, 640)
|
||||
|
||||
# 获取设备列表并分类
|
||||
current_devices = list_adb_devices(adb_exe)
|
||||
wifi_devices = get_connected_wifi_devices(adb_exe)
|
||||
usb_devices = [d for d in current_devices if d not in wifi_devices]
|
||||
|
||||
canvas = tk.Canvas(dialog, bg=theme.BG, highlightthickness=0, bd=0)
|
||||
scroll = ttk.Scrollbar(dialog, orient="vertical", command=canvas.yview)
|
||||
canvas.configure(yscrollcommand=scroll.set)
|
||||
canvas.pack(side="left", fill="both", expand=True)
|
||||
scroll.pack(side="right", fill="y")
|
||||
shell = tk.Frame(canvas, bg=theme.BG)
|
||||
shell_window = canvas.create_window((0, 0), window=shell, anchor="nw")
|
||||
shell.bind("<Configure>", lambda _e: canvas.configure(scrollregion=canvas.bbox("all")))
|
||||
canvas.bind("<Configure>", lambda e: canvas.itemconfigure(shell_window, width=e.width))
|
||||
|
||||
content = tk.Frame(shell, bg=theme.BG)
|
||||
content.pack(fill="both", expand=True, padx=22, pady=18)
|
||||
|
||||
header = tk.Frame(content, bg=theme.BG)
|
||||
header.pack(fill="x", pady=(0, 14))
|
||||
title_box = tk.Frame(header, bg=theme.BG)
|
||||
title_box.pack(side="left", fill="x", expand=True)
|
||||
tk.Label(title_box, text="WiFi ADB 设置", bg=theme.BG, fg=theme.TEXT, font=TITLE_FONT).pack(anchor="w")
|
||||
tk.Label(
|
||||
title_box,
|
||||
text="保留原有连接流程,优化设备选择与操作可读性",
|
||||
bg=theme.BG,
|
||||
fg=theme.MUTED,
|
||||
font=SUBTITLE_FONT,
|
||||
).pack(anchor="w", pady=(3, 0))
|
||||
_status_pill(header, f"USB {len(usb_devices)}", ok=bool(usb_devices)).pack(side="right", padx=(8, 0))
|
||||
_status_pill(header, f"WiFi {len(wifi_devices)}", ok=bool(wifi_devices), active=False).pack(side="right", padx=(8, 0))
|
||||
|
||||
# 创建设备选择区域
|
||||
device_frame = ttk.LabelFrame(dialog, text="设备选择", padding=10)
|
||||
device_frame.pack(fill=X, padx=10, pady=10)
|
||||
# 使内部 grid 列随窗口宽度伸缩
|
||||
device_frame.grid_columnconfigure(0, weight=3)
|
||||
device_frame.grid_columnconfigure(1, weight=1)
|
||||
device_card, device_frame = _card(content, "设备选择", "首次启用需要 USB,日常可直接选择 WiFi 设备")
|
||||
device_card.pack(fill="x", pady=(0, 14))
|
||||
device_frame.grid_columnconfigure(0, weight=1, uniform="device")
|
||||
device_frame.grid_columnconfigure(1, weight=1, uniform="device")
|
||||
|
||||
# USB设备选择
|
||||
ttk.Label(device_frame, text="USB设备(用于首次启用):").grid(
|
||||
row=0, column=0, sticky=W, pady=(0, 5)
|
||||
)
|
||||
usb_group = _field_group(device_frame, "USB设备(用于首次启用)")
|
||||
usb_group.grid(row=0, column=0, sticky="nsew", padx=(0, 10))
|
||||
usb_device_var = tk.StringVar(value=(usb_devices[0] if usb_devices else ""))
|
||||
usb_combo = ttk.Combobox(
|
||||
device_frame,
|
||||
usb_group,
|
||||
textvariable=usb_device_var,
|
||||
values=usb_devices,
|
||||
width=25,
|
||||
width=34,
|
||||
state="readonly" if not usb_devices else "normal",
|
||||
style="WifiADB.TCombobox",
|
||||
font=BODY_FONT,
|
||||
)
|
||||
usb_combo.grid(row=1, column=0, padx=(0, 10), pady=(0, 10), sticky="we")
|
||||
usb_combo.pack(fill="x", padx=14, pady=(0, 10), ipady=5)
|
||||
|
||||
# 显示USB设备状态
|
||||
usb_status_text = (
|
||||
@@ -82,27 +168,23 @@ def open_wifi_adb_dialog(
|
||||
if usb_devices
|
||||
else "未检测到USB设备,请确保设备已连接并授权"
|
||||
)
|
||||
usb_status_label = ttk.Label(
|
||||
device_frame,
|
||||
text=usb_status_text,
|
||||
font=("Arial", 8),
|
||||
foreground="red" if not usb_devices else "green",
|
||||
)
|
||||
usb_status_label.grid(row=2, column=0, sticky=W, pady=(0, 10))
|
||||
usb_status_label = _status_pill(usb_group, usb_status_text, ok=bool(usb_devices))
|
||||
usb_status_label.pack(anchor="w", padx=14, pady=(0, 14))
|
||||
|
||||
# WiFi设备选择
|
||||
ttk.Label(device_frame, text="WiFi设备(已连接):").grid(
|
||||
row=0, column=1, sticky=W, pady=(0, 5)
|
||||
)
|
||||
wifi_group = _field_group(device_frame, "WiFi设备(已连接)")
|
||||
wifi_group.grid(row=0, column=1, sticky="nsew", padx=(10, 0))
|
||||
wifi_device_var = tk.StringVar(value=(wifi_devices[0] if wifi_devices else ""))
|
||||
wifi_combo = ttk.Combobox(
|
||||
device_frame,
|
||||
wifi_group,
|
||||
textvariable=wifi_device_var,
|
||||
values=wifi_devices,
|
||||
width=25,
|
||||
width=34,
|
||||
state="readonly" if not wifi_devices else "normal",
|
||||
style="WifiADB.TCombobox",
|
||||
font=BODY_FONT,
|
||||
)
|
||||
wifi_combo.grid(row=1, column=1, pady=(0, 10), sticky="we")
|
||||
wifi_combo.pack(fill="x", padx=14, pady=(0, 10), ipady=5)
|
||||
|
||||
# 显示WiFi设备状态
|
||||
wifi_status_text = (
|
||||
@@ -110,38 +192,32 @@ def open_wifi_adb_dialog(
|
||||
if wifi_devices
|
||||
else "无WiFi设备连接"
|
||||
)
|
||||
wifi_status_label = ttk.Label(
|
||||
device_frame,
|
||||
text=wifi_status_text,
|
||||
font=("Arial", 8),
|
||||
foreground="blue" if wifi_devices else "gray",
|
||||
)
|
||||
wifi_status_label.grid(row=2, column=1, sticky=W, pady=(0, 10))
|
||||
wifi_status_label = _status_pill(wifi_group, wifi_status_text, ok=bool(wifi_devices), active=False)
|
||||
wifi_status_label.pack(anchor="w", padx=14, pady=(0, 14))
|
||||
|
||||
# IP地址输入区域
|
||||
ip_frame = ttk.LabelFrame(dialog, text="连接信息", padding=10)
|
||||
ip_frame.pack(fill=X, padx=10, pady=(0, 10))
|
||||
# 使 IP/端口 输入框随窗口宽度伸缩
|
||||
ip_card, ip_frame = _card(content, "连接信息", "手动连接时填写设备 IP 与端口")
|
||||
ip_card.pack(fill=X, pady=(0, 14))
|
||||
ip_frame.grid_columnconfigure(0, weight=3)
|
||||
ip_frame.grid_columnconfigure(1, weight=1)
|
||||
|
||||
ttk.Label(ip_frame, text="设备IP地址:").grid(
|
||||
row=0, column=0, sticky=W, pady=(0, 5)
|
||||
tk.Label(ip_frame, text="设备IP地址", bg=theme.SURFACE, fg=theme.TEXT, font=LABEL_FONT).grid(
|
||||
row=0, column=0, sticky=W, pady=(0, 8)
|
||||
)
|
||||
ip_var = tk.StringVar()
|
||||
ip_entry = ttk.Entry(ip_frame, textvariable=ip_var, width=25)
|
||||
ip_entry.grid(row=1, column=0, padx=(0, 10), pady=(0, 10), sticky="we")
|
||||
ip_entry = ttk.Entry(ip_frame, textvariable=ip_var, width=30, style="WifiADB.TEntry", font=BODY_FONT)
|
||||
ip_entry.grid(row=1, column=0, padx=(0, 14), pady=(0, 2), sticky="we", ipady=7)
|
||||
|
||||
ttk.Label(ip_frame, text="端口(默认5555):").grid(
|
||||
row=0, column=1, sticky=W, pady=(0, 5)
|
||||
tk.Label(ip_frame, text="端口(默认5555)", bg=theme.SURFACE, fg=theme.TEXT, font=LABEL_FONT).grid(
|
||||
row=0, column=1, sticky=W, pady=(0, 8)
|
||||
)
|
||||
port_var = tk.StringVar(value="5555")
|
||||
port_entry = ttk.Entry(ip_frame, textvariable=port_var, width=25)
|
||||
port_entry.grid(row=1, column=1, pady=(0, 10), sticky="we")
|
||||
port_entry = ttk.Entry(ip_frame, textvariable=port_var, width=16, style="WifiADB.TEntry", font=BODY_FONT)
|
||||
port_entry.grid(row=1, column=1, pady=(0, 2), sticky="we", ipady=7)
|
||||
|
||||
# 按钮区域
|
||||
button_frame = ttk.Frame(dialog)
|
||||
button_frame.pack(fill=X, padx=10, pady=10)
|
||||
action_card, button_frame = _card(content, "设备操作", "按当前连接方式选择对应动作")
|
||||
action_card.pack(fill=X, pady=(0, 14))
|
||||
|
||||
# 放大/恢复窗口支持(当系统边框无法调整窗口时提供备用按钮)
|
||||
is_maximized = False
|
||||
@@ -350,63 +426,83 @@ def open_wifi_adb_dialog(
|
||||
on_line("[WiFi ADB] 设备列表已刷新")
|
||||
|
||||
# USB设备操作按钮
|
||||
usb_button_frame = ttk.Frame(button_frame)
|
||||
usb_button_frame.pack(fill=X, pady=(0, 10))
|
||||
button_frame.grid_columnconfigure(0, weight=1, uniform="actions")
|
||||
button_frame.grid_columnconfigure(1, weight=1, uniform="actions")
|
||||
button_frame.grid_columnconfigure(2, weight=1, uniform="actions")
|
||||
usb_button_frame = tk.Frame(button_frame, bg=theme.SURFACE_ALT, highlightthickness=1, highlightbackground=theme.BORDER)
|
||||
usb_button_frame.grid(row=0, column=0, sticky="nsew", padx=(0, 10))
|
||||
|
||||
ttk.Label(usb_button_frame, text="USB设备操作:").pack(anchor=W)
|
||||
usb_buttons_frame = ttk.Frame(usb_button_frame)
|
||||
usb_buttons_frame.pack(fill=X, pady=(5, 0))
|
||||
tk.Label(usb_button_frame, text="USB首次启用", bg=theme.SURFACE_ALT, fg=theme.TEXT, font=LABEL_FONT).pack(anchor=W, padx=14, pady=(13, 8))
|
||||
usb_buttons_frame = tk.Frame(usb_button_frame, bg=theme.SURFACE_ALT)
|
||||
usb_buttons_frame.pack(fill=X, padx=14, pady=(0, 14))
|
||||
|
||||
ttk.Button(usb_buttons_frame, text="自动连接", command=auto_connect_wifi).pack(
|
||||
side=LEFT, padx=(0, 10)
|
||||
)
|
||||
ttk.Button(usb_buttons_frame, text="启用WiFi ADB", command=enable_wifi).pack(
|
||||
side=LEFT, padx=(0, 10)
|
||||
)
|
||||
ttk.Button(usb_buttons_frame, text="连接", command=connect_wifi).pack(
|
||||
side=LEFT, padx=(0, 10)
|
||||
)
|
||||
ttk.Button(
|
||||
usb_buttons_frame, text="刷新设备", command=refresh_device_lists
|
||||
).pack(side=LEFT)
|
||||
# 如果窗口无法通过边框调整,提供放大/恢复按钮作为备用
|
||||
ttk.Button(usb_buttons_frame, text="放大/恢复", command=toggle_maximize).pack(
|
||||
side=LEFT, padx=(8, 0)
|
||||
_action_grid(
|
||||
usb_buttons_frame,
|
||||
(
|
||||
("自动连接", auto_connect_wifi, "primary", 150),
|
||||
("启用WiFi ADB", enable_wifi, "soft", 170),
|
||||
),
|
||||
columns=1,
|
||||
)
|
||||
|
||||
# WiFi设备操作按钮
|
||||
wifi_button_frame = ttk.Frame(button_frame)
|
||||
wifi_button_frame.pack(fill=X, pady=(10, 0))
|
||||
wifi_button_frame = tk.Frame(button_frame, bg=theme.SURFACE_ALT, highlightthickness=1, highlightbackground=theme.BORDER)
|
||||
wifi_button_frame.grid(row=0, column=1, sticky="nsew", padx=(10, 10))
|
||||
|
||||
ttk.Label(wifi_button_frame, text="WiFi设备操作:").pack(anchor=W)
|
||||
wifi_buttons_frame = ttk.Frame(wifi_button_frame)
|
||||
wifi_buttons_frame.pack(fill=X, pady=(5, 0))
|
||||
tk.Label(wifi_button_frame, text="WiFi连接操作", bg=theme.SURFACE_ALT, fg=theme.TEXT, font=LABEL_FONT).pack(anchor=W, padx=14, pady=(13, 8))
|
||||
wifi_buttons_frame = tk.Frame(wifi_button_frame, bg=theme.SURFACE_ALT)
|
||||
wifi_buttons_frame.pack(fill=X, padx=14, pady=(0, 14))
|
||||
|
||||
ttk.Button(wifi_buttons_frame, text="断开连接", command=disconnect_wifi).pack(
|
||||
side=LEFT
|
||||
)
|
||||
ttk.Button(
|
||||
_action_grid(
|
||||
wifi_buttons_frame,
|
||||
text="扫描局域网",
|
||||
command=lambda: open_scan_dialog(
|
||||
dialog, adb_exe, ip_var, on_line, refresh_device_lists
|
||||
(
|
||||
("连接", connect_wifi, "primary", 124),
|
||||
("断开连接", disconnect_wifi, "soft", 132),
|
||||
("扫描局域网", lambda: open_scan_dialog(dialog, adb_exe, ip_var, on_line, refresh_device_lists), "soft", 142),
|
||||
),
|
||||
).pack(side=LEFT, padx=(10, 0))
|
||||
columns=1,
|
||||
)
|
||||
|
||||
# 通用工具
|
||||
tools_button_frame = tk.Frame(button_frame, bg=theme.SURFACE_ALT, highlightthickness=1, highlightbackground=theme.BORDER)
|
||||
tools_button_frame.grid(row=0, column=2, sticky="nsew", padx=(10, 0))
|
||||
tk.Label(tools_button_frame, text="通用工具", bg=theme.SURFACE_ALT, fg=theme.TEXT, font=LABEL_FONT).pack(anchor=W, padx=14, pady=(13, 8))
|
||||
tools_buttons_frame = tk.Frame(tools_button_frame, bg=theme.SURFACE_ALT)
|
||||
tools_buttons_frame.pack(fill=X, padx=14, pady=(0, 14))
|
||||
_action_grid(
|
||||
tools_buttons_frame,
|
||||
(
|
||||
("刷新设备", refresh_device_lists, "soft", 132),
|
||||
("放大/恢复", toggle_maximize, "soft", 132),
|
||||
),
|
||||
columns=1,
|
||||
)
|
||||
|
||||
# 说明文本
|
||||
info_text = """重要说明:
|
||||
• Android系统安全要求:首次启用WiFi ADB必须通过USB连接
|
||||
• 工作流程:USB连接 → 启用WiFi ADB → 设备重启 → WiFi连接
|
||||
• 设置完成后,设备会出现在"WiFi设备"列表中,无需再次USB连接
|
||||
• 设备重启后WiFi ADB模式会保持,可直接通过WiFi连接使用
|
||||
help_card, help_body = _card(content, "重要说明", "为什么首次必须接 USB")
|
||||
help_card.pack(fill="both", expand=True)
|
||||
help_body.grid_columnconfigure(0, weight=1)
|
||||
help_body.grid_columnconfigure(1, weight=1)
|
||||
|
||||
使用方法:
|
||||
1. 连接Android设备到电脑(USB)
|
||||
2. 点击"刷新设备"确保设备被检测到
|
||||
3. 选择USB设备,点击"自动连接"或手动操作
|
||||
4. 等待设备重启后即可通过WiFi使用"""
|
||||
notes = tk.Frame(help_body, bg=theme.SURFACE_ALT, highlightthickness=1, highlightbackground=theme.BORDER)
|
||||
notes.grid(row=0, column=0, sticky="nsew", padx=(0, 10))
|
||||
steps = tk.Frame(help_body, bg=theme.SURFACE_ALT, highlightthickness=1, highlightbackground=theme.BORDER)
|
||||
steps.grid(row=0, column=1, sticky="nsew", padx=(10, 0))
|
||||
|
||||
info_label = ttk.Label(
|
||||
dialog, text=info_text, justify=LEFT, font=("Arial", 9), wraplength=460
|
||||
)
|
||||
info_label.pack(pady=(10, 0), padx=20, anchor="w")
|
||||
tk.Label(notes, text="连接规则", bg=theme.SURFACE_ALT, fg=theme.TEXT, font=LABEL_FONT).pack(anchor=W, padx=14, pady=(12, 6))
|
||||
for line in (
|
||||
"Android 首次启用 WiFi ADB 必须通过 USB 连接",
|
||||
"流程:USB连接 -> 启用WiFi ADB -> 设备重启 -> WiFi连接",
|
||||
"设置完成后,设备会出现在 WiFi 设备列表中",
|
||||
"设备重启后 WiFi ADB 模式会保持,可继续通过 WiFi 使用",
|
||||
):
|
||||
tk.Label(notes, text=f"• {line}", bg=theme.SURFACE_ALT, fg=theme.MUTED, font=HELP_FONT, anchor=W, justify=LEFT, wraplength=360).pack(fill=X, padx=14, pady=2)
|
||||
|
||||
tk.Label(steps, text="使用方法", bg=theme.SURFACE_ALT, fg=theme.TEXT, font=LABEL_FONT).pack(anchor=W, padx=14, pady=(12, 6))
|
||||
for line in (
|
||||
"1. 连接 Android 设备到电脑(USB)",
|
||||
"2. 点击“刷新设备”确保设备被检测到",
|
||||
"3. 选择 USB 设备,点击“自动连接”或手动操作",
|
||||
"4. 等待设备重启后即可通过 WiFi 使用",
|
||||
):
|
||||
tk.Label(steps, text=line, bg=theme.SURFACE_ALT, fg=theme.MUTED, font=HELP_FONT, anchor=W, justify=LEFT, wraplength=360).pack(fill=X, padx=14, pady=2)
|
||||
@@ -70,14 +70,33 @@ class DashboardApp:
|
||||
top.pack(fill="x", padx=20, pady=(14, 8))
|
||||
brand = tk.Frame(top, bg=theme.SURFACE)
|
||||
brand.pack(fill="x", padx=20, pady=(12, 5))
|
||||
brand.grid_columnconfigure(1, weight=1)
|
||||
mark = tk.Frame(brand, bg=theme.TEAL, width=34, height=34)
|
||||
mark.pack(side="left", padx=(0, 12))
|
||||
mark.grid(row=0, column=0, sticky="w", padx=(0, 12))
|
||||
mark.pack_propagate(False)
|
||||
tk.Label(mark, text="抖", bg=theme.TEAL, fg="#ffffff", font=("Microsoft YaHei UI", 15, "bold")).pack(expand=True)
|
||||
title_box = tk.Frame(brand, bg=theme.SURFACE)
|
||||
title_box.pack(side="left")
|
||||
title_box.grid(row=0, column=1, sticky="w")
|
||||
tk.Label(title_box, text="抖音自动化助手", bg=theme.SURFACE, fg=theme.TEXT, font=("Microsoft YaHei UI", 16, "bold")).pack(anchor="w")
|
||||
tk.Label(title_box, text="轻量数据看板入口", bg=theme.SURFACE, fg=theme.SUBTLE, font=theme.FONT_SMALL).pack(anchor="w")
|
||||
quick_state = tk.Frame(brand, bg=theme.SURFACE)
|
||||
quick_state.grid(row=0, column=2, sticky="e")
|
||||
tk.Label(
|
||||
quick_state,
|
||||
textvariable=self.status_var,
|
||||
bg=theme.TEAL_SOFT,
|
||||
fg=theme.TEAL_DARK,
|
||||
font=("Microsoft YaHei UI", 11, "bold"),
|
||||
padx=14,
|
||||
pady=6,
|
||||
).pack(side="right")
|
||||
tk.Label(
|
||||
quick_state,
|
||||
text="当前状态",
|
||||
bg=theme.SURFACE,
|
||||
fg=theme.MUTED,
|
||||
font=theme.FONT_SMALL,
|
||||
).pack(side="right", padx=(0, 8))
|
||||
tool_row = tk.Frame(top, bg=theme.SURFACE)
|
||||
tool_row.pack(fill="x", padx=20, pady=(0, 12))
|
||||
tool_row.grid_columnconfigure(5, weight=1)
|
||||
|
||||
Reference in new issue
Block a user