You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 

42 lines
598 B

package dialogs
import (
"strings"
"github.com/rivo/tview"
)
const (
DialogFormHeight = 3
DialogMinWidth = 40
DialogPadding = 3
TableHeightOffset = 3
)
type Dialog interface {
tview.Primitive
Display()
Hide()
IsDisplay() bool
}
func getMessageWidth(message string) int {
var messageWidth int
for _, msg := range strings.Split(message, "\n") {
if len(msg) > messageWidth {
messageWidth = len(msg)
}
}
return messageWidth
}
func CheckDialogFocus(dialogs ...Dialog) bool {
for _, dia := range dialogs {
if dia.HasFocus() {
return true
}
}
return false
}