5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 20:29:37 +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 {
// App icon ID is 3
icon, err := NewIconFromResource(w32.GetModuleHandle(""), uint16(3))
if err == nil {
w.setIcon(icon)
} else {
// Load the icon from the application icon bytes
if err != nil {
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 {
w.disableIcon()