ui

package
v0.5.37 Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	StyleTitle = lipgloss.NewStyle().
				Foreground(colorPrimary).
				Bold(true).
				Padding(0, 1)

	StylePanel = lipgloss.NewStyle().
				Border(lipgloss.RoundedBorder()).
				BorderForeground(colorMuted)

	StylePanelActive = lipgloss.NewStyle().
						Border(lipgloss.RoundedBorder()).
						BorderForeground(colorPrimary)

	StylePeerOnline = lipgloss.NewStyle().
					Foreground(colorGreen)

	StylePeerOffline = lipgloss.NewStyle().
						Foreground(colorMuted)

	StyleMessage = lipgloss.NewStyle().
					Foreground(colorText)

	StyleMessageMine = lipgloss.NewStyle().
						Foreground(colorSecond)

	StyleInput = lipgloss.NewStyle().
				Foreground(colorText).
				BorderStyle(lipgloss.NormalBorder()).
				BorderTop(true).
				BorderForeground(colorMuted)

	StyleHelp = lipgloss.NewStyle().
				Foreground(colorMuted).
				Italic(true)

	StyleError = lipgloss.NewStyle().
				Foreground(colorRed)
)

Functions

func DisplayVersion added in v0.5.30

func DisplayVersion(version string) string

Types

type Message

type Message struct {
	From    string
	Content string
	Mine    bool
}

type Model

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

func New

func New(nickname string) Model

func NewWithChannels

func NewWithChannels(nickname string, sendCh chan<- core.SendRequest, nickCh chan<- string, connectCh chan<- string) Model

func (Model) Init

func (m Model) Init() tea.Cmd

func (Model) Update

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

func (Model) View

func (m Model) View() string

func (Model) WithVersion added in v0.5.25

func (m Model) WithVersion(version string) Model

type MsgError

type MsgError struct{ Err error }

type MsgFileDone

type MsgFileDone struct {
	From, Name, SavePath string
	Outgoing             bool
}

type MsgFileProgress

type MsgFileProgress struct {
	From            string
	Received, Total int64
	Outgoing        bool
}

type MsgFileStart

type MsgFileStart struct {
	From, Name string
	Size       int64
	Outgoing   bool
}

type MsgLocalAddr

type MsgLocalAddr struct{ Addr string }

type MsgLog added in v0.2.2

type MsgLog struct{ Text string }

type MsgNicknameSet

type MsgNicknameSet struct{ Nickname string }

type MsgPeerFound

type MsgPeerFound struct{ Info bnet.PeerInfo }

type MsgPeerLost

type MsgPeerLost struct{ ID peer.ID }

type MsgTextReceived

type MsgTextReceived struct{ From, Content string }

type Screen

type Screen int
const (
	ScreenSetup Screen = iota
	ScreenMain
)

Jump to

Keyboard shortcuts

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