Moved the menu to a new structure.

This commit is contained in:
2025-06-09 23:30:05 +05:00
parent e6db590937
commit 077d7a82a9
4 changed files with 87 additions and 2 deletions

29
internal/gui/menu/main.go Normal file
View File

@@ -0,0 +1,29 @@
package menu
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/lang"
)
func MainMenuSettings(
actionMainSettings func(),
actionFFPathSelection func(),
) *fyne.Menu {
quit := fyne.NewMenuItem(lang.L("exit"), nil)
quit.IsQuit = true
settingsSelection := fyne.NewMenuItem(lang.L("settings"), actionMainSettings)
ffPathSelection := fyne.NewMenuItem(lang.L("changeFFPath"), actionFFPathSelection)
return fyne.NewMenu(lang.L("settings"), settingsSelection, ffPathSelection, quit)
}
func MainMenuHelp(
actionAbout func(),
actionHelpFFplay func(),
) *fyne.Menu {
about := fyne.NewMenuItem(lang.L("about"), actionAbout)
helpFFplay := fyne.NewMenuItem(lang.L("helpFFplay"), actionHelpFFplay)
return fyne.NewMenu(lang.L("help"), helpFFplay, about)
}