release: bump version to 6.6.25+2606241
主要变更: 1. 新增桌面端托盘图标支持深色/浅色主题切换 2. 重构应用锁、动画配置、小组件导航服务职责 3. 修复Riverpod初始化断言、防重复点击、工作台模式残留选中态问题 4. 优化诗词服务、阅读进度、搜索结果空状态体验 5. 完善macOS打包配置与错误静默处理逻辑 6. 新增快速卡片多语言适配与动画退出队列管理
This commit is contained in:
@@ -2,13 +2,16 @@
|
||||
"""
|
||||
闲言APP — 系统托盘图标生成脚本
|
||||
创建时间: 2026-06-18
|
||||
作用: 用 Pillow 生成 macOS/Windows 托盘图标 PNG(浅色+深色两套)
|
||||
更新时间: 2026-06-22
|
||||
作用: 用 Pillow 生成 macOS/Windows 托盘图标 PNG + ICO(浅色+深色两套)
|
||||
设计: 对话气泡 + 三条横线,体现"记录言语"主题
|
||||
输出:
|
||||
- assets/images/tray_icon_light.png (黑色图标,用于 macOS template + Win 浅色主题)
|
||||
- assets/images/tray_icon_dark.png (白色图标,用于 Win 深色主题)
|
||||
- assets/images/tray_icon_light_32.png (32x32 高清版)
|
||||
- assets/images/tray_icon_dark_32.png (32x32 高清版)
|
||||
- windows/runner/resources/tray_icon_light.ico (黑色图标,Win 浅色主题)
|
||||
- windows/runner/resources/tray_icon_dark.ico (白色图标,Win 深色/纯黑主题)
|
||||
"""
|
||||
|
||||
import os
|
||||
@@ -17,8 +20,11 @@ from PIL import Image, ImageDraw
|
||||
# ============================================================
|
||||
# 配置
|
||||
# ============================================================
|
||||
OUTPUT_DIR = os.path.join(os.path.dirname(__file__), '..', 'assets', 'images')
|
||||
PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
OUTPUT_DIR = os.path.join(PROJECT_ROOT, 'assets', 'images')
|
||||
WIN_ICO_DIR = os.path.join(PROJECT_ROOT, 'windows', 'runner', 'resources')
|
||||
SIZES = [16, 32] # 生成 16x16 和 32x32 两种尺寸
|
||||
ICO_SIZES = [16, 24, 32, 48, 64] # ICO 文件包含多种尺寸
|
||||
|
||||
# 颜色定义
|
||||
COLOR_LIGHT = (0, 0, 0, 255) # 黑色(浅色主题用)
|
||||
@@ -102,6 +108,7 @@ def draw_tray_icon(size: int, color: tuple) -> Image.Image:
|
||||
def main():
|
||||
"""主函数:生成所有图标"""
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
os.makedirs(WIN_ICO_DIR, exist_ok=True)
|
||||
|
||||
for size in SIZES:
|
||||
# 浅色版(黑色图标)
|
||||
@@ -118,6 +125,31 @@ def main():
|
||||
dark_img.save(dark_path, 'PNG')
|
||||
print(f'✅ 生成: {dark_path} ({size}x{size})')
|
||||
|
||||
# ============================================================
|
||||
# 生成 Windows ICO 文件(包含多尺寸)
|
||||
# ============================================================
|
||||
# 浅色 ICO(黑色图标,白天模式用)
|
||||
light_ico_images = [draw_tray_icon(s, COLOR_LIGHT) for s in ICO_SIZES]
|
||||
light_ico_path = os.path.join(WIN_ICO_DIR, 'tray_icon_light.ico')
|
||||
light_ico_images[0].save(
|
||||
light_ico_path,
|
||||
format='ICO',
|
||||
sizes=[(s, s) for s in ICO_SIZES],
|
||||
append_images=light_ico_images[1:],
|
||||
)
|
||||
print(f'✅ 生成: {light_ico_path} (ICO 多尺寸)')
|
||||
|
||||
# 深色 ICO(白色图标,深色/纯黑模式用)
|
||||
dark_ico_images = [draw_tray_icon(s, COLOR_DARK) for s in ICO_SIZES]
|
||||
dark_ico_path = os.path.join(WIN_ICO_DIR, 'tray_icon_dark.ico')
|
||||
dark_ico_images[0].save(
|
||||
dark_ico_path,
|
||||
format='ICO',
|
||||
sizes=[(s, s) for s in ICO_SIZES],
|
||||
append_images=dark_ico_images[1:],
|
||||
)
|
||||
print(f'✅ 生成: {dark_ico_path} (ICO 多尺寸)')
|
||||
|
||||
print('\n🎉 所有托盘图标生成完成!')
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user