Skip to content

Commit

Permalink
fix(popup): Get icon from exe if A_IconFile is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
imawizard committed Oct 15, 2023
1 parent a8f8a97 commit a1454e9
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions lib/Popup.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -72,9 +72,19 @@ class Popup {
g.Show("Hide")

if showIcon {
icon := g.Add("Picture", "Icon1", A_IconFile)
icon.GetPos(, , &iconWidth, &iconHeight)
file := A_IconFile
if !file {
path := RegExReplace(A_ScriptFullPath, "i)\.ahk$", ".exe")
if FileExist(path) {
file := path
}
}
if file {
icon := g.Add("Picture", "Icon1", file)
icon.GetPos(, , &iconWidth, &iconHeight)
}
} else {
icon := ""
iconWidth := 0
iconHeight := 0
}
Expand All @@ -95,7 +105,7 @@ class Popup {
(guiHeight - msgHeight) // 2,
)

if showIcon {
if icon {
icon.Move(
horzPadding / 4.5,
(guiHeight - iconHeight) // 2,
Expand Down

0 comments on commit a1454e9

Please sign in to comment.