Compare commits

..

2 Commits
v0.1.0 ... main

Author SHA1 Message Date
Maarten Heremans
7325554288 Updated i18n to v0.1.0 2024-08-12 14:39:46 +02:00
Maarten Heremans
40dad494d9 Added ability to prevent closing the app when the view is displayed 2024-08-12 14:37:42 +02:00
5 changed files with 14 additions and 4 deletions

View File

@ -148,3 +148,7 @@ func (v *BaseView) RegisterResizeCallback(cb ResizeCallbackFn) {
func (v *BaseView) RegisterMoveCallback(cb MoveCallbackFn) {
v.ScreenHandler.RegisterMoveCallback(cb)
}
func (v BaseView) PreventClose() bool {
return false
}

View File

@ -5,11 +5,11 @@ import (
"fmt"
"io/fs"
"gitea.hevanto-it.com/hevanto/ui/screen"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/widget"
"gitea.hevanto-it.com/hevanto/ui/screen"
"github.com/google/uuid"
"github.com/nicksnyder/go-i18n/v2/i18n"
)
@ -256,6 +256,10 @@ func (d *BaseDialog) GetCanvasObject() fyne.CanvasObject {
return d.CanvasObj
}
func (d BaseDialog) PreventClose() bool {
return false
}
type FormDialogItemsFn func() []*widget.FormItem
type FormDialog struct {

2
go.mod
View File

@ -5,7 +5,7 @@ go 1.22.1
require (
fyne.io/fyne/v2 v2.4.5
fyne.io/x/fyne v0.0.0-20240421102438-d5a080914907
gitea.hevanto-it.com/hevanto/i18n v0.0.0-20240806081720-4a6834a50d3a
gitea.hevanto-it.com/hevanto/i18n v0.1.0
github.com/google/uuid v1.6.0
github.com/nicksnyder/go-i18n/v2 v2.4.0
gopkg.in/yaml.v2 v2.4.0

4
go.sum
View File

@ -41,8 +41,8 @@ fyne.io/fyne/v2 v2.4.5 h1:W6jpAEmLoBbKyBB+EXqI7GMJ7kLgHQWCa0wZHUV2VfQ=
fyne.io/fyne/v2 v2.4.5/go.mod h1:SlOgbca0y80cRObu/JOhxIJdIgtoW7aCyqUVlTMgs0Y=
fyne.io/x/fyne v0.0.0-20240421102438-d5a080914907 h1:Ajr8gCMkVv6f7H2IPviMjfZCq40/+HrgWhAh/ZUOm/k=
fyne.io/x/fyne v0.0.0-20240421102438-d5a080914907/go.mod h1:1pa3ZVIopRWNvfSG4ZrSkcZ3mJ8qoHPZv4PT8/zpn1o=
gitea.hevanto-it.com/hevanto/i18n v0.0.0-20240806081720-4a6834a50d3a h1:6SENHUL+vj+VRTD9+26d+28CIVFKjIJ2Es3IdNLMONc=
gitea.hevanto-it.com/hevanto/i18n v0.0.0-20240806081720-4a6834a50d3a/go.mod h1:Ib85itweX6FuNHKFJNlMHglTq02TqaYdgvr4xDaQtQY=
gitea.hevanto-it.com/hevanto/i18n v0.1.0 h1:SHsFugp1p+1a63MYrkXVAfgRp1zTSXWv3a6c/gU9Oy0=
gitea.hevanto-it.com/hevanto/i18n v0.1.0/go.mod h1:Ib85itweX6FuNHKFJNlMHglTq02TqaYdgvr4xDaQtQY=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/BurntSushi/toml v1.3.2 h1:o7IhLm0Msx3BaB+n3Ag7L8EVlByGnpq14C4YWiu/gL8=
github.com/BurntSushi/toml v1.3.2/go.mod h1:CxXYINrC8qIiEnFrOxCa7Jy5BFHlXnUU2pbicEuybxQ=

View File

@ -54,4 +54,6 @@ type View interface {
OnHide()
GetCanvasObject() fyne.CanvasObject
PreventClose() bool
}