Add gratitude view and menu item

Introduce a new "Gratitude" view with localized messages and display functionality.
This commit is contained in:
2025-05-11 18:35:21 +05:00
parent 411e6c554a
commit 992762ef0a
5 changed files with 65 additions and 1 deletions

View File

@@ -86,9 +86,16 @@ func (h MenuHandler) getMenuHelp() *fyne.Menu {
about.Label = text
})
gratitude := fyne.NewMenuItem(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "gratitude",
}), h.openGratitude)
h.app.GetLocalizerService().AddChangeCallback("gratitude", func(text string) {
gratitude.Label = text
})
help := fyne.NewMenu(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "help",
}), about)
}), about, gratitude)
h.app.GetLocalizerService().AddChangeCallback("help", func(text string) {
help.Label = text
help.Refresh()
@@ -114,6 +121,10 @@ func (h MenuHandler) openAbout() {
h.menuView.About(ffmpeg, ffprobe)
}
func (h MenuHandler) openGratitude() {
h.menuView.Gratitude()
}
func (h MenuHandler) LanguageSelection() {
h.localizerView.LanguageSelection(func(lang kernel.Lang) {
_, _ = h.localizerRepository.Save(lang.Code)