Skip to content

Commit

Permalink
Merge pull request #420 from TecReaGroup/master
Browse files Browse the repository at this point in the history
Fix: Unable to change preview background image
  • Loading branch information
WEIFENG2333 authored Mar 2, 2025
2 parents b1750d9 + 9c24e92 commit b7a3ba1
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions app/view/subtitle_style_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,12 +557,19 @@ def updatePreview(self):

# 获取预览方向
orientation = self.orientationCard.comboBox.currentText()
preview_image = (
DEFAULT_BG_LANDSCAPE if orientation == "横屏" else DEFAULT_BG_PORTRAIT
)
path = preview_image["path"]
width = preview_image["width"]
height = preview_image["height"]
default_preview = DEFAULT_BG_LANDSCAPE if orientation == "横屏" else DEFAULT_BG_PORTRAIT

# 检查是否存在用户自定义背景图片
user_bg_path = cfg.get(cfg.subtitle_preview_image)
if user_bg_path and Path(user_bg_path).exists():
path = user_bg_path
# 可以保持默认宽高或获取实际图片宽高
width = default_preview["width"]
height = default_preview["height"]
else:
path = default_preview["path"]
width = default_preview["width"]
height = default_preview["height"]

# 创建预览线程
self.preview_thread = PreviewThread(
Expand Down

0 comments on commit b7a3ba1

Please sign in to comment.