Add gratitude view and menu item
Introduce a new "Gratitude" view with localized messages and display functionality.
This commit is contained in:
35
menu/view.go
35
menu/view.go
@@ -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",
|
||||
|
Reference in New Issue
Block a user