diff --git a/cmd/cbconvert-gui/handlers.go b/cmd/cbconvert-gui/handlers.go index 8461de1..1c053ee 100644 --- a/cmd/cbconvert-gui/handlers.go +++ b/cmd/cbconvert-gui/handlers.go @@ -271,6 +271,7 @@ func onRemove(ih iup.Ihandle) int { // clearPreview resets the preview state and repaints the canvas to its empty state. func clearPreview() { + iup.Destroy(iup.GetHandle("cover")) hasCover = false previewPath = "" previewPage = 0 diff --git a/cmd/cbconvert-gui/widgets.go b/cmd/cbconvert-gui/widgets.go index f7c527d..83c45eb 100644 --- a/cmd/cbconvert-gui/widgets.go +++ b/cmd/cbconvert-gui/widgets.go @@ -167,6 +167,7 @@ func previewMessage(ih iup.Ihandle, s string, i int, p any) int { hasCover = true iup.GetHandle("PreviewInfo").SetAttribute("TITLE", fmt.Sprintf("%s (%dx%d)", img.SizeHuman, img.Width, img.Height)) } else { + iup.Destroy(iup.GetHandle("cover")) hasCover = false iup.GetHandle("PreviewInfo").SetAttribute("TITLE", "")