fix(win): load window icon from ICO on disk + buffer PNG (1.0.6)
Release / release (push) Successful in 5m8s
Release / release (push) Successful in 5m8s
nativeImage from paths inside app.asar often yields empty images on Windows. Ship icon.ico via extraResources and read with createFromBuffer; setIcon on boot + app windows. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,6 +4,8 @@ import { app, BrowserWindow } from 'electron';
|
||||
|
||||
import { getAppSemanticVersion } from '../versionInfo';
|
||||
|
||||
import { loadBrandingWindowIcon } from './brandingIcon';
|
||||
|
||||
let bootSplashRef: BrowserWindow | null = null;
|
||||
|
||||
export function getBootSplashWindow(): BrowserWindow | null {
|
||||
@@ -37,6 +39,7 @@ function bootWebPreferences(): Electron.WebPreferences {
|
||||
* Показывать после `waitForBootWindowReady`.
|
||||
*/
|
||||
export function createBootWindow(): BrowserWindow {
|
||||
const icon = loadBrandingWindowIcon();
|
||||
const win = new BrowserWindow({
|
||||
width: 440,
|
||||
height: 420,
|
||||
@@ -50,8 +53,16 @@ export function createBootWindow(): BrowserWindow {
|
||||
transparent: false,
|
||||
backgroundColor: '#09090B',
|
||||
roundedCorners: true,
|
||||
...(icon ? { icon } : {}),
|
||||
webPreferences: bootWebPreferences(),
|
||||
});
|
||||
if (icon) {
|
||||
try {
|
||||
win.setIcon(icon);
|
||||
} catch {
|
||||
/* ignore */
|
||||
}
|
||||
}
|
||||
|
||||
bootSplashRef = win;
|
||||
win.once('closed', () => {
|
||||
|
||||
Reference in New Issue
Block a user