popup

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Credit to @TypicalAM https://github.com/TypicalAM/goread

Credit to @TypicalAM https://github.com/TypicalAM/goread

Credit to @TypicalAM https://github.com/TypicalAM/goread/

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IPopup added in v0.0.5

type IPopup interface {
	Init() tea.Cmd
	Update(msg tea.Msg) (IPopup, tea.Cmd)
	View() string
	Resize(msg tea.WindowSizeMsg, bgRaw string) IPopup
}

type Overlay

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

Overlay allows you to overlay text on top of a background and achieve a popup.

func NewOverlay

func NewOverlay(bgRaw string, popupWidth, popupHeight int) Overlay

NewOverlay creates a new overlay and computes the necessary indices.

func (Overlay) Height

func (p Overlay) Height() int

Height returns the height of the popup window.

func (Overlay) Width

func (p Overlay) Width() int

Width returns the width of the popup window.

func (Overlay) WrapView

func (p Overlay) WrapView(view string) string

WrapView overlays the given text on top of the background. TODO: Maybe handle the box here. It's a bit weird to have to do it in the view.

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

Popup is the feed popup where a user can create/edit a feed.

func NewPopup

func NewPopup(bgRaw string, title string, width, height int) Popup

NewPopup returns a new feed popup.

func (Popup) GetStyles added in v0.0.5

func (p Popup) GetStyles() popupStyle

func (Popup) Init

func (p Popup) Init() tea.Cmd

Init initializes the popup.

func (Popup) Resize added in v0.0.5

func (p Popup) Resize(msg tea.WindowSizeMsg, bgRaw string) Popup

func (Popup) SetFg

func (p Popup) SetFg(fg string) Popup

func (Popup) Update

func (p Popup) Update(msg tea.Msg) (Popup, tea.Cmd)

Update updates the popup.

func (Popup) View

func (p Popup) View() string

View renders the popup.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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