feat: custom terminal background image + theme editor hardening

- settings: backgroundImage/backgroundImageOpacity (10..100, default 60)
- main: otimg:// protocol serves only the configured background file
  (path-allowlisted, 403 otherwise); dev http origin cannot load file:
- TerminalView: allowTransparency + transparent theme background while an
  image is set; .term-bg-image layer behind the xterm surface
- terminal.css: .has-bg-image keeps .xterm-viewport transparent — the old
  chrome-bg pin covered the image layer (root cause of image not showing)
- ThemeSettingsTab: image picker + opacity slider
- ThemeEditor: duplicate-name hint now covers builtin names too; seed
  colors normalized to #rrggbb
- settingsStore: sanitize theme colors, reject non-hex values
This commit is contained in:
Bill committed 2026-09-20 23:24:43 +08:00
1 parent c94e0fbac7
commit 481f54ed59
13 files changed
+187 -17

No files matched your search

+6
View File
@@ -133,12 +133,18 @@ const settings: Record<string, string> = {
'settings.highlight.builtin.url': '網址連結',
'settings.theme.accent': '標籤強調色',
'settings.theme.accentDesc': '作用中標籤的邊框、側邊欄指示條與 SSH 徽章的強調顏色',
'settings.theme.backgroundImage': '背景圖片',
'settings.theme.backgroundImageDesc': '為終端設定一張背景圖片;移除後恢復純色背景',
'settings.theme.chooseImage': '選擇圖片',
'settings.theme.clearImage': '移除圖片',
'settings.theme.imageOpacity': '圖片不透明度',
'settings.theme.customBadge': '自訂',
'settings.theme.deleteTitle': '刪除自訂主題',
'settings.theme.create': '新增主題',
'settings.theme.editTitle': '編輯主題',
'settings.themeEditor.name': '名稱',
'settings.themeEditor.namePlaceholder': '主題名稱',
'settings.themeEditor.duplicateName': '與其他主題同名,仍可儲存',
'settings.themeEditor.copySuffix': '(副本)',
'settings.about.currentVersion': '目前版本',
'settings.about.statusIdle': '點擊檢查更新',