diff --git a/FyneApp.toml b/FyneApp.toml new file mode 100644 index 0000000..2e1b0aa --- /dev/null +++ b/FyneApp.toml @@ -0,0 +1,6 @@ +[Details] +Icon = "assets/logo/VT_Icon.png" +Name = "VideoTools" +ID = "com.leaktechnologies.videotools" +Version = "0.1.0-dev19" +Build = 19 diff --git a/VideoTools.desktop b/VideoTools.desktop new file mode 100644 index 0000000..b579a7e --- /dev/null +++ b/VideoTools.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=VideoTools +Comment=Video conversion and processing tool +Exec=/home/stu/Projects/VideoTools/VideoTools +Icon=/home/stu/Projects/VideoTools/assets/logo/VT_Icon.png +Terminal=false +Categories=AudioVideo;Video; +StartupWMClass=VideoTools diff --git a/internal/utils/utils.go b/internal/utils/utils.go index d5eec5d..10d0c81 100644 --- a/internal/utils/utils.go +++ b/internal/utils/utils.go @@ -240,13 +240,23 @@ func MakeIconButton(symbol, tooltip string, tapped func()) *widget.Button { // LoadAppIcon loads the application icon from standard locations func LoadAppIcon() fyne.Resource { - search := []string{ - filepath.Join("assets", "logo", "VT_Icon.svg"), + // Try PNG first (better compatibility), then SVG + iconFiles := []string{"VT_Icon.png", "VT_Icon.svg"} + var search []string + + // Search in current directory first + for _, iconFile := range iconFiles { + search = append(search, filepath.Join("assets", "logo", iconFile)) } + + // Then search relative to executable if exe, err := os.Executable(); err == nil { dir := filepath.Dir(exe) - search = append(search, filepath.Join(dir, "assets", "logo", "VT_Icon.svg")) + for _, iconFile := range iconFiles { + search = append(search, filepath.Join(dir, "assets", "logo", iconFile)) + } } + for _, p := range search { if _, err := os.Stat(p); err == nil { res, err := fyne.LoadResourceFromPath(p) @@ -254,8 +264,10 @@ func LoadAppIcon() fyne.Resource { logging.Debug(logging.CatUI, "failed to load icon %s: %v", p, err) continue } + logging.Debug(logging.CatUI, "loaded app icon from %s", p) return res } } + logging.Debug(logging.CatUI, "no app icon found in search paths") return nil }