- Removed obsolete command-line test parameters from `run_cli.py` to streamline functionality. - Introduced a new `ocr_preprocess.py` module for unified OCR image preprocessing, enhancing recognition stability. - Updated various components to utilize the new preprocessing function, improving code organization and readability. - Adjusted configuration values in `config.json` for better performance and consistency. - Added comprehensive technical documentation for the Douyin project, detailing code modification standards and operational guidelines. - Cleaned up excessive blank lines across multiple files to enhance overall readability.
74 lines
777 B
Python
74 lines
777 B
Python
"""主窗口组件
|
|
|
|
包含主窗口布局和事件绑定的GUI组件。
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from typing import Any, Callable
|
|
import tkinter as tk
|
|
from tkinter import ttk
|
|
|
|
|
|
def create_main_window(
|
|
title: str = "抖音福袋挂机 - 可视化控制台",
|
|
geometry: str = "1400x900",
|
|
) -> Any:
|
|
"""创建主窗口。
|
|
|
|
参数:
|
|
title: 窗口标题
|
|
geometry: 窗口尺寸
|
|
|
|
返回:
|
|
root窗口对象
|
|
"""
|
|
# ttkbootstrap 优先(更美观);没装则回退到原生 tkinter
|
|
try:
|
|
import ttkbootstrap as tb
|
|
root = tb.Window(themename="darkly")
|
|
except Exception:
|
|
root = tk.Tk()
|
|
|
|
root.title(title)
|
|
root.geometry(geometry)
|
|
|
|
return root
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|