Embed application icon as a resource and refactor icon usage

Replaced the external `icon.png` file with an embedded resource using Go's embed functionality. Updated all references to use the new resource, eliminating the need for the standalone icon file.
This commit is contained in:
2025-06-01 19:58:28 +05:00
parent 3241b88158
commit 43d794373a
6 changed files with 19 additions and 5 deletions

View File

@@ -6,6 +6,7 @@ import (
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/internal/resources"
"git.kor-elf.net/kor-elf/gui-for-ffmpeg/kernel"
"golang.org/x/image/colornames"
"net/url"
@@ -32,7 +33,7 @@ func (v View) Gratitude() {
view.Resize(fyne.Size{Width: 500, Height: 400})
view.SetFixedSize(true)
image := canvas.NewImageFromFile("icon.png")
image := canvas.NewImageFromResource(resources.IconAppLogoResource())
image.SetMinSize(fyne.Size{Width: 100, Height: 100})
image.FillMode = canvas.ImageFillContain
@@ -103,7 +104,7 @@ func (v View) About(ffmpegVersion string, ffprobeVersion string, ffplayVersion s
Text: v.app.GetLocalizerService().GetMessage("aboutText"),
},
)
image := canvas.NewImageFromFile("icon.png")
image := canvas.NewImageFromResource(resources.IconAppLogoResource())
image.SetMinSize(fyne.Size{Width: 100, Height: 100})
image.FillMode = canvas.ImageFillContain