ui

package
v1.0.17 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ColorInput

type ColorInput struct {
	*tview.Flex
	// contains filtered or unexported fields
}

ColorInput is a form item that combines an input field with a color drop-down.

func NewColorInput

func NewColorInput(label, laneColor string, colors []string) *ColorInput

NewColorInput creates a new ColorInput. colors is a slice of color names. The first entry should be "default".

func (*ColorInput) GetFieldHeight

func (c *ColorInput) GetFieldHeight() int

GetFieldHeight returns the field height.

func (*ColorInput) GetFieldWidth

func (c *ColorInput) GetFieldWidth() int

GetFieldWidth returns 0 to use available width.

func (*ColorInput) GetLabel

func (c *ColorInput) GetLabel() string

GetLabel returns the item's label text.

func (*ColorInput) InputHandler

func (c *ColorInput) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler handles tab navigation between input field and dropdown.

func (*ColorInput) SetFinishedFunc

func (c *ColorInput) SetFinishedFunc(handler func(key tcell.Key)) tview.FormItem

SetFinishedFunc installs a handler for the input field.

func (*ColorInput) SetFormAttributes

func (c *ColorInput) SetFormAttributes(labelWidth int, labelColor, bgColor, fieldTextColor, fieldBgColor tcell.Color) tview.FormItem

SetFormAttributes sets form attributes for both widgets.

type ColorModal added in v1.0.17

type ColorModal struct {
	*tview.Form
	DialogHeight int
	// contains filtered or unexported fields
}

ColorModal is a simple modal with a dropdown for lane color

func NewColorModal added in v1.0.17

func NewColorModal(title, current string) *ColorModal

func (*ColorModal) Draw added in v1.0.17

func (m *ColorModal) Draw(screen tcell.Screen)

Draw draws this modal with a surrounding frame.

func (*ColorModal) Focus added in v1.0.17

func (m *ColorModal) Focus(delegate func(p tview.Primitive))

func (*ColorModal) GetFrame added in v1.0.17

func (m *ColorModal) GetFrame() *tview.Frame

func (*ColorModal) HasFocus added in v1.0.17

func (m *ColorModal) HasFocus() bool

func (*ColorModal) InputHandler added in v1.0.17

func (m *ColorModal) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

func (*ColorModal) MouseHandler added in v1.0.17

func (m *ColorModal) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (bool, tview.Primitive)

func (*ColorModal) SetDoneFunc added in v1.0.17

func (m *ColorModal) SetDoneFunc(handler func(string, bool))

func (*ColorModal) SetFocus added in v1.0.17

func (m *ColorModal) SetFocus(index int) *ColorModal

type Lanes

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

func NewLanes

func NewLanes(content *model.ToDoContent, app *tview.Application, mode, todoDirModes, version string) *Lanes

func (*Lanes) ActiveIndex

func (l *Lanes) ActiveIndex() int

func (*Lanes) CmdAbout

func (l *Lanes) CmdAbout()

func (*Lanes) CmdAddMode

func (l *Lanes) CmdAddMode()

func (*Lanes) CmdAddTask

func (l *Lanes) CmdAddTask()

func (*Lanes) CmdArchiveNote

func (l *Lanes) CmdArchiveNote()

func (*Lanes) CmdEditNote

func (l *Lanes) CmdEditNote()

func (*Lanes) CmdEditTask

func (l *Lanes) CmdEditTask()

func (*Lanes) CmdExit

func (l *Lanes) CmdExit()

func (*Lanes) CmdLanesCmds

func (l *Lanes) CmdLanesCmds()

func (*Lanes) CmdRemoveModeDialog

func (l *Lanes) CmdRemoveModeDialog()

func (*Lanes) CmdSelectModeDialog

func (l *Lanes) CmdSelectModeDialog()

func (*Lanes) CmdSelectNote

func (l *Lanes) CmdSelectNote()

func (*Lanes) CmdSortDialog

func (l *Lanes) CmdSortDialog()

func (*Lanes) Focus

func (l *Lanes) Focus()

func (*Lanes) GetActiveLaneName

func (l *Lanes) GetActiveLaneName() string

func (*Lanes) GetUi

func (l *Lanes) GetUi() *tview.Pages

func (*Lanes) HotKeyHandler

func (l *Lanes) HotKeyHandler(event *tcell.EventKey) *tcell.EventKey

func (*Lanes) ListValidModes

func (l *Lanes) ListValidModes(activeMode string) ([]string, int, error)

func (*Lanes) ListValidModesRemoveProvided

func (l *Lanes) ListValidModesRemoveProvided(activeMode string) ([]string, int, error)

func (*Lanes) Lists

func (l *Lanes) Lists() []*tview.List

func (*Lanes) NextLaneFocus

func (l *Lanes) NextLaneFocus() int

func (*Lanes) NextMode

func (l *Lanes) NextMode() string

func (*Lanes) RedrawAllLanes

func (l *Lanes) RedrawAllLanes()

func (*Lanes) SetMoveHelpButton

func (l *Lanes) SetMoveHelpButton(b *tview.Button)

type ModalInput

type ModalInput struct {
	*tview.Form
	DialogHeight int
	// contains filtered or unexported fields
}

ModalInput is based on Modal from tview, but has an input field instead

func NewModalInput

func NewModalInput(title string) *ModalInput

func NewModalInputLane

func NewModalInputLane(title, laneDescription string, dialogHeight int, initialInput1 string) *ModalInput

func NewModalInputMode

func NewModalInputMode(title, modeDirectory string) *ModalInput

func (*ModalInput) ClearExtras

func (m *ModalInput) ClearExtras()

ClearExtras disables priority dropdown and info lines.

func (*ModalInput) Draw

func (m *ModalInput) Draw(screen tcell.Screen)

Draw draws this primitive onto the screen.

func (*ModalInput) DueValid

func (m *ModalInput) DueValid() bool

DueValid reports whether the current due value can be parsed.

func (*ModalInput) Focus

func (m *ModalInput) Focus(delegate func(p tview.Primitive))

Focus delegates focus to the internal form.

func (*ModalInput) GetColor

func (m *ModalInput) GetColor() string

GetColor returns the currently selected color value.

func (*ModalInput) GetDueISO

func (m *ModalInput) GetDueISO() string

GetDueISO returns the due date in ISO format or empty if not set.

func (*ModalInput) GetFrame

func (m *ModalInput) GetFrame() *tview.Frame

func (*ModalInput) GetPriority

func (m *ModalInput) GetPriority() int

GetPriority returns the currently selected priority value.

func (*ModalInput) HasFocus

func (m *ModalInput) HasFocus() bool

HasFocus returns whether the form has focus.

func (*ModalInput) InputHandler

func (m *ModalInput) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*ModalInput) MouseHandler

func (m *ModalInput) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler forwards mouse events to the form and captures clicks inside the dialog.

func (*ModalInput) SetColor

func (m *ModalInput) SetColor(color string)

SetColor enables a color dropdown with the given value.

func (*ModalInput) SetDoneFunc

func (m *ModalInput) SetDoneFunc(handler func(string, string, bool)) *ModalInput

SetDoneFunc sets the done func for this input. Will be called with the text of the input and a boolean for OK or cancel button.

func (*ModalInput) SetDue

func (m *ModalInput) SetDue(date string)

SetDue enables a due date input field with the given value using locale formatting.

func (*ModalInput) SetFocus

func (m *ModalInput) SetFocus(index int) *ModalInput

SetFocus passes the focus index to the embedded form.

func (*ModalInput) SetInfo

func (m *ModalInput) SetInfo(createdBy, created, updatedBy, updated string)

SetInfo sets the creation and modification information to be shown.

func (*ModalInput) SetLaneColor added in v1.0.17

func (m *ModalInput) SetLaneColor(color string)

SetLaneColor sets the lane background color used for the color dropdown.

func (*ModalInput) SetPriority

func (m *ModalInput) SetPriority(value int)

SetPriority enables a priority dropdown with the given value (1-4).

func (*ModalInput) SetValue

func (m *ModalInput) SetValue(text string, secondary string, due string)

SetValue sets the current value in the item

type SortModal

type SortModal struct {
	*tview.Form
	DialogHeight int
	// contains filtered or unexported fields
}

SortModal is a simple modal with a dropdown for sort mode

func NewSortModal

func NewSortModal(title, lane string, current string) *SortModal

func (*SortModal) Draw

func (m *SortModal) Draw(screen tcell.Screen)

Draw draws this modal with a surrounding frame.

func (*SortModal) Focus

func (m *SortModal) Focus(delegate func(p tview.Primitive))

Focus delegates focus to the embedded form.

func (*SortModal) GetFrame

func (m *SortModal) GetFrame() *tview.Frame

func (*SortModal) HasFocus

func (m *SortModal) HasFocus() bool

HasFocus returns whether the form has focus.

func (*SortModal) InputHandler

func (m *SortModal) InputHandler() func(event *tcell.EventKey, setFocus func(p tview.Primitive))

InputHandler returns the handler for this primitive.

func (*SortModal) MouseHandler

func (m *SortModal) MouseHandler() func(action tview.MouseAction, event *tcell.EventMouse, setFocus func(p tview.Primitive)) (consumed bool, capture tview.Primitive)

MouseHandler forwards mouse events to the form and captures clicks inside the dialog.

func (*SortModal) SetDoneFunc

func (m *SortModal) SetDoneFunc(handler func(string, bool))

func (*SortModal) SetFocus

func (m *SortModal) SetFocus(index int) *SortModal

SetFocus passes the focus index to the embedded form.

Jump to

Keyboard shortcuts

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