Add gratitude view and menu item
Introduce a new "Gratitude" view with localized messages and display functionality.
This commit is contained in:
parent
411e6c554a
commit
992762ef0a
@ -86,9 +86,16 @@ func (h MenuHandler) getMenuHelp() *fyne.Menu {
|
|||||||
about.Label = text
|
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{
|
help := fyne.NewMenu(h.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "help",
|
MessageID: "help",
|
||||||
}), about)
|
}), about, gratitude)
|
||||||
h.app.GetLocalizerService().AddChangeCallback("help", func(text string) {
|
h.app.GetLocalizerService().AddChangeCallback("help", func(text string) {
|
||||||
help.Label = text
|
help.Label = text
|
||||||
help.Refresh()
|
help.Refresh()
|
||||||
@ -114,6 +121,10 @@ func (h MenuHandler) openAbout() {
|
|||||||
h.menuView.About(ffmpeg, ffprobe)
|
h.menuView.About(ffmpeg, ffprobe)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (h MenuHandler) openGratitude() {
|
||||||
|
h.menuView.Gratitude()
|
||||||
|
}
|
||||||
|
|
||||||
func (h MenuHandler) LanguageSelection() {
|
func (h MenuHandler) LanguageSelection() {
|
||||||
h.localizerView.LanguageSelection(func(lang kernel.Lang) {
|
h.localizerView.LanguageSelection(func(lang kernel.Lang) {
|
||||||
_, _ = h.localizerRepository.Save(lang.Code)
|
_, _ = h.localizerRepository.Save(lang.Code)
|
||||||
|
@ -282,6 +282,14 @@ other = "File:"
|
|||||||
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
|
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
|
||||||
other = "Preset"
|
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]
|
[help]
|
||||||
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
|
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
|
||||||
other = "Help"
|
other = "Help"
|
||||||
|
@ -282,6 +282,14 @@ other = "Файл:"
|
|||||||
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
|
hash = "sha1-7759891ba1ef9f7adc70defc7ac18fbf149c1a68"
|
||||||
other = "Алдын ала орнатылған"
|
other = "Алдын ала орнатылған"
|
||||||
|
|
||||||
|
[gratitude]
|
||||||
|
hash = "sha1-51968fc38e53a9a11c861126c62404674fd6096f"
|
||||||
|
other = "Алғыс"
|
||||||
|
|
||||||
|
[gratitudeText]
|
||||||
|
hash = "sha1-cb343e4d39ca31e6da6f72b9394cc915cb7d1258"
|
||||||
|
other = "Сізге баға жетпес және уақтылы көмектескеніңіз\n\r үшін шын жүректен алғыс айтамын:"
|
||||||
|
|
||||||
[help]
|
[help]
|
||||||
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
|
hash = "sha1-6a45cef900c668effcb2ab10da05855c1fd10f6f"
|
||||||
other = "Анықтама"
|
other = "Анықтама"
|
||||||
|
@ -69,6 +69,8 @@ ffmpegLGPL = "Это программное обеспечение исполь
|
|||||||
ffmpegTrademark = "**FFmpeg** — торговая марка **[Fabrice Bellard](http://bellard.org/)** , создателя проекта **[FFmpeg](https://ffmpeg.org/about.html)**."
|
ffmpegTrademark = "**FFmpeg** — торговая марка **[Fabrice Bellard](http://bellard.org/)** , создателя проекта **[FFmpeg](https://ffmpeg.org/about.html)**."
|
||||||
fileForConversionTitle = "Файл:"
|
fileForConversionTitle = "Файл:"
|
||||||
formPreset = "Предустановка"
|
formPreset = "Предустановка"
|
||||||
|
gratitude = "Благодарность"
|
||||||
|
gratitudeText = "Я искренне благодарю вас за неоценимую\n\rи своевременную помощь:"
|
||||||
help = "Справка"
|
help = "Справка"
|
||||||
inProgressQueue = "Выполняется"
|
inProgressQueue = "Выполняется"
|
||||||
languageSelectionFormHead = "Переключить язык"
|
languageSelectionFormHead = "Переключить язык"
|
||||||
|
35
menu/view.go
35
menu/view.go
@ -13,6 +13,7 @@ import (
|
|||||||
|
|
||||||
type ViewContract interface {
|
type ViewContract interface {
|
||||||
About(ffmpegVersion string, ffprobeVersion string)
|
About(ffmpegVersion string, ffprobeVersion string)
|
||||||
|
Gratitude()
|
||||||
}
|
}
|
||||||
|
|
||||||
type View struct {
|
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) {
|
func (v View) About(ffmpegVersion string, ffprobeVersion string) {
|
||||||
view := v.app.GetAppFyne().NewWindow(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
view := v.app.GetAppFyne().NewWindow(v.app.GetLocalizerService().GetMessage(&i18n.LocalizeConfig{
|
||||||
MessageID: "about",
|
MessageID: "about",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user