dialog

package
v0.0.0-...-56f1d57 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 19, 2025 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const DialogHeight = 15

Variables

This section is empty.

Functions

func DialogStatusCmd

func DialogStatusCmd(message DialogStatusMsg) tea.Cmd

func HelpDialog

func HelpDialog(entries ...HelpEntry) tea.Model

func New

func New(message string, cancelOnly bool, standalone bool, width int) tea.Model

func NewConfirmDialog

func NewConfirmDialog(message string, width int) tea.Model

Creates a new confirmation dialog

This is a convenience method to create a confirmation dialog containing both yes and no buttons

func NewOKDialog

func NewOKDialog(message string, width int) tea.Model

Creates a new OK dialog

This is a convenience method to create a confirmation dialog that only has an OK button

func NewStanaloneOKDialog

func NewStanaloneOKDialog(message string, width int) tea.Model

Create a new OK dialog

For standalone applications only

This is a convenience method for creating an OK dialog that runs inside a TMUX popup window.

This method should not be used from inside the main window. Use NewOKDialog for that

func NewStandaloneConfirmDialog

func NewStandaloneConfirmDialog(message string, width int) tea.Model

Create a new standalone confirmation dialog

For standalone applications only

This is a convenience method for creating dialogs that run inside a TMUX popup window.

This method should not be used from inside the main window. Use NewConfirmDialog for that

Types

type Dialog

type Dialog struct {
	// contains filtered or unexported fields
}

func (*Dialog) GetSize

func (m *Dialog) GetSize() (int, int)

func (*Dialog) Init

func (m *Dialog) Init() tea.Cmd

func (*Dialog) Overlay

func (m *Dialog) Overlay() helpers.UseOverlay

func (*Dialog) SetSize

func (m *Dialog) SetSize(w, h int)

func (*Dialog) Status

func (m *Dialog) Status() Status

func (*Dialog) Update

func (m *Dialog) Update(msg tea.Msg) (tea.Model, tea.Cmd)

func (*Dialog) View

func (m *Dialog) View() string

type DialogStatusMsg

type DialogStatusMsg struct {
	Selected Status
	Done     bool
	Message  string
}

type HelpEntry

type HelpEntry struct {
	// The title to use for this help entry
	Title string

	// TRhe keymap associated with this help entry
	Keymap *help.KeyMap

	// An optional help message
	Help string
}

A HelpEntry represents an item to be added to the help dialog.

type Status

type Status int
const (
	NoChg Status = iota
	Confirm
	Cancel
)

type UseHelp

type UseHelp interface {
	Help() HelpEntry
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL