Add app icon support and window sizing improvements
- Update LoadAppIcon() to search for PNG first (better Linux support) - Add FyneApp.toml for icon metadata and Windows embedding - Create VideoTools.desktop for Linux application launcher integration - Change default window size from 1200x700 to 800x600 - Icon now appears in taskbar, app switcher, and Windows title bar 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
601acf9ccf
commit
f558119f4f
6
FyneApp.toml
Normal file
6
FyneApp.toml
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
[Details]
|
||||
Icon = "assets/logo/VT_Icon.png"
|
||||
Name = "VideoTools"
|
||||
ID = "com.leaktechnologies.videotools"
|
||||
Version = "0.1.0-dev19"
|
||||
Build = 19
|
||||
10
VideoTools.desktop
Normal file
10
VideoTools.desktop
Normal file
|
|
@ -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
|
||||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user