Files
video-subtitle-remover/ui/icon/my_fluent_icon.py
yaofanguk c80e7fabc9 添加PyInstaller打包支持和运行时路径修复
- 创建PyInstaller规范文件和打包脚本
- 修复开发/打包环境路径兼容性问题
- 添加PaddleOCR运行时依赖(opencv-contrib-python, pypdfium2, pyclipper)
- 支持打包后的多进程启动
- 修复图标路径和翻译文件路径
- 清理重复的模型和FFmpeg文件
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-04-10 19:23:05 +08:00

22 lines
706 B
Python

import os
import sys
from enum import Enum
from qfluentwidgets import getIconColor, Theme, FluentIconBase
class MyFluentIcon(FluentIconBase, Enum):
Stop = "stop"
def path(self, theme=Theme.AUTO):
# getIconColor() return "white" or "black" according to current theme
# 支持打包环境和开发环境
if getattr(sys, 'frozen', False):
# 打包环境:使用 sys._MEIPASS 作为基础路径
base_path = sys._MEIPASS
else:
# 开发环境:使用相对路径
base_path = os.path.join(os.path.dirname(__file__), '..')
return os.path.join(base_path, 'ui', 'icon', f'{self.value}_{getIconColor(theme)}.svg')