Add gratitude view and menu item

Introduce a new "Gratitude" view with localized messages and display functionality.
This commit is contained in:
Leonid Nikitin 2025-05-11 18:35:21 +05:00
parent 411e6c554a
commit 992762ef0a
Signed by: kor-elf
GPG Key ID: DAB5355A11C22541
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)

View File

@ -282,6 +282,14 @@ other = "File:"
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
other = "Preset"
[gratitude]
hash = "sha1-51968fc38e53a9a11c861126c62404674fd6096f"
other = "Gratitude"
[gratitudeText]
hash = "sha1-cb343e4d39ca31e6da6f72b9394cc915cb7d1258"
other = "I sincerely thank you for your invaluable\n\r and timely assistance:"
[help]
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
other = "Help"

View File

@ -282,6 +282,14 @@ other = "Файл:"
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
other = "Алдын ала орнатылған"
[gratitude]
hash = "sha1-51968fc38e53a9a11c861126c62404674fd6096f"
other = "Алғыс"
[gratitudeText]
hash = "sha1-cb343e4d39ca31e6da6f72b9394cc915cb7d1258"
other = "Сізге баға жетпес және уақтылы көмектескеніңіз\n\r үшін шын жүректен алғыс айтамын:"
[help]
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
other = "Анықтама"

View File

@ -69,6 +69,8 @@ ffmpegLGPL = "Это программное обеспечение исполь
ffmpegTrademark = "**FFmpeg** — торговая марка **[Fabrice Bellard](http://bellard.org/)** , создателя проекта **[FFmpeg](https://ffmpeg.org/about.html)**."
fileForConversionTitle = "Файл:"
formPreset = "Предустановка"
gratitude = "Благодарность"
gratitudeText = "Я искренне благодарю вас за неоценимую\n\rи своевременную помощь:"
help = "Справка"
inProgressQueue = "Выполняется"
languageSelectionFormHead = "Переключить язык"

View File

@ -13,6 +13,7 @@ import (
type ViewContract interface {
About(ffmpegVersion string, ffprobeVersion string)
Gratitude()
}
type View struct {
@ -25,6 +26,40 @@ func NewView(app kernel.AppContract) *View {
}
}
func (v View) Gratitude() {
view := v.app.GetAppFyne().NewWindow(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "gratitude",
}))
view.Resize(fyne.Size{Width: 500, Height: 400})
view.SetFixedSize(true)
image := canvas.NewImageFromFile("icon.png")
image.SetMinSize(fyne.Size{Width: 100, Height: 100})
image.FillMode = canvas.ImageFillContain
gratitude := canvas.NewText(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "gratitude",
}), colornames.Darkgreen)
gratitude.TextStyle = fyne.TextStyle{Bold: true}
gratitude.TextSize = 20
view.SetContent(
container.NewScroll(container.NewVBox(
container.NewBorder(nil, nil, container.NewVBox(image), nil, container.NewVBox(
gratitude,
widget.NewLabel(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "gratitudeText",
})),
widget.NewLabel("Екатерина"),
widget.NewLabel("Евгений"),
),
))),
)
view.CenterOnScreen()
view.Show()
}
func (v View) About(ffmpegVersion string, ffprobeVersion string) {
view := v.app.GetAppFyne().NewWindow(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
MessageID: "about",