5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-05 01:50:56 +08:00

[windows] Improve Set window icon when in debug mode

This commit is contained in:
Lea Anthony 2024-04-01 05:02:39 +11:00
parent eee373f15a
commit 88ff84f5a5
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405

View File

@ -271,14 +271,13 @@ func (w *windowsWebviewWindow) run() {
if !options.Windows.DisableIcon { if !options.Windows.DisableIcon {
// App icon ID is 3 // App icon ID is 3
icon, err := NewIconFromResource(w32.GetModuleHandle(""), uint16(3)) icon, err := NewIconFromResource(w32.GetModuleHandle(""), uint16(3))
if err == nil { if err != nil {
w.setIcon(icon)
} else {
// Load the icon from the application icon bytes
icon, err = w32.CreateLargeHIconFromImage(globalApplication.options.Icon) icon, err = w32.CreateLargeHIconFromImage(globalApplication.options.Icon)
if err == nil { }
w.setIcon(icon) if err != nil {
} globalApplication.Logger.Warn("Failed to load icon: %v", err)
} else {
w.setIcon(icon)
} }
} else { } else {
w.disableIcon() w.disableIcon()