confirm.go 660 B

123456789101112131415161718192021
  1. package views
  2. import (
  3. "fyne.io/fyne/v2"
  4. "fyne.io/fyne/v2/container"
  5. "fyne.io/fyne/v2/theme"
  6. "fyne.io/fyne/v2/widget"
  7. "github.com/gravitl/netmaker/netclient/gui/components"
  8. )
  9. // GetConfirmation - displays a confirmation message
  10. func GetConfirmation(msg string, onCancel, onConfirm func()) fyne.CanvasObject {
  11. return container.NewGridWithColumns(1,
  12. container.NewCenter(widget.NewLabel(msg)),
  13. container.NewCenter(
  14. container.NewHBox(
  15. components.ColoredIconButton("Confirm", theme.ConfirmIcon(), onConfirm, components.Gravitl_color),
  16. components.ColoredIconButton("Cancel", theme.CancelIcon(), onCancel, components.Danger_color),
  17. )),
  18. )
  19. }