Files
douyin_guaji-main/gui/components/main_window.py
T
Your Name a0aad21835 feat: Optimize ADB exec-out and OCR performance
- Introduced performance enhancements for ADB exec-out, reducing execution time by 10-20% through the use of Popen with streaming reads, increased buffer sizes, and removal of unnecessary fsync calls.
- Implemented optimizations in OCR processing, cutting recognition time by 50% by refining button recognition logic and improving image loading and preprocessing methods.
- Added detailed performance diagnostics and configuration options to facilitate further optimizations.
- Created new documentation files outlining the performance improvements and recommendations for future enhancements.
2026-01-02 02:06:01 +08:00

87 lines
790 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