Added ability to prevent closing the app when the view is displayed
This commit is contained in:
		@@ -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
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
@@ -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 {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user