Fix application icon not showing in PyInstaller builds

The icon wasn't working in frozen executables because:
1. LocalTranscription.png wasn't being bundled in the PyInstaller build
2. The code was using Path(__file__).parent which doesn't work in frozen exes

Changes:
- Added LocalTranscription.png to datas in local-transcription.spec
- Updated main.py to use sys._MEIPASS for frozen executables
- Updated gui/main_window_qt.py to use sys._MEIPASS for frozen executables
- Both files now detect if running frozen and adjust icon path accordingly

The icon will now appear correctly in:
- Window titlebar
- Taskbar (Windows) / Dock (macOS)
- Alt-Tab switcher

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-28 20:35:53 -08:00
parent c968eb8a48
commit 95e9e8ebad
3 changed files with 18 additions and 2 deletions

View File

@@ -36,6 +36,7 @@ except ImportError:
binaries = []
datas = [
('config/default_config.yaml', 'config'),
('LocalTranscription.png', '.'), # Include icon for runtime window icon
(vad_assets_path, 'faster_whisper/assets'), # Include VAD model
] + pvporcupine_data_files # Include pvporcupine resources
hiddenimports = [