utils

package
v0.0.0-...-4ec974a Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2022 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MainPageGridTitleColor   = tcell.ColorOrange
	MainPageGridBorderColor  = tcell.ColorLightGrey
	MainPageTableTitleColor  = tcell.ColorLightSkyBlue
	MainPageTableBorderColor = tcell.ColorGrey

	LoggedMainPageTitleColor     = tcell.ColorLightGoldenrodYellow
	LoggedMainPagePubStatusColor = tcell.ColorSandyBrown

	GuestMainPageTitleColor = tcell.ColorOrange
	GuestMainPageDescColor  = tcell.ColorLightGrey
	GuestMainPageTagColor   = tcell.ColorLightSteelBlue
)
View Source
const (
	AnimePageGridTitleColor   = tcell.ColorOrange
	AnimePageGridBorderColor  = tcell.ColorLightGrey
	AnimePageTableTitleColor  = tcell.ColorLightSkyBlue
	AnimePageTableBorderColor = tcell.ColorGrey

	AnimePageInfoViewTitleColor  = tcell.ColorLightSkyBlue
	AnimePageInfoViewBorderColor = tcell.ColorLightGrey

	AnimePageChapNumColor      = tcell.ColorLightYellow
	AnimePageTitleColor        = tcell.ColorLightSkyBlue
	AnimePageDownloadStatColor = tcell.ColorPowderBlue
	AnimePageWatchStatColor    = tcell.ColorOrange
	AnimePageScanGroupColor    = tcell.ColorDarkSalmon
	AnimePageHighlightColor    = tcell.ColorMediumSpringGreen
)
View Source
const (
	SearchPageGridTitleColor   = tcell.ColorOrange
	SearchPageGridBorderColor  = tcell.ColorLightGrey
	SearchPageTableTitleColor  = tcell.ColorLightSkyBlue
	SearchPageTableBorderColor = tcell.ColorGrey

	SearchFormLabelColor = tcell.ColorWhite
)
View Source
const (
	MainPageID   = "main_page"
	AnimePageID  = "anime_page"
	HelpPageID   = "help_page"
	SearchPageID = "search_page"

	DownloadModalID         = "download_modal"
	WatchOrDownloadModalID  = "watch_download_modal"
	DownloadFinishedModalID = "download_error_modal"
	ToggleWatchAnimeModalID = "toggle_watch_anime_modal"
	GenericAPIErrorModalID  = "api_error_modal"
	InfoModalID             = "info_modal_ID"
	OffsetErrorModalID      = "offset_error_modal"
)
View Source
const (
	HelpPageBorderColor = tcell.ColorLightGrey
)
View Source
const (
	ModalColor = tcell.ColorDarkSlateGrey
)

Variables

This section is empty.

Functions

func NewGrid

func NewGrid(row, col []int) *tview.Grid

NewGrid : Create a new grid with specified rows and columns.

Types

type ContextWrapper

type ContextWrapper struct {
	Ctx    context.Context
	Cancel context.CancelFunc
}

ContextWrapper : A wrapper around a context and its corresponding Cancel function.

func (*ContextWrapper) ResetContext

func (c *ContextWrapper) ResetContext() (context.Context, context.CancelFunc)

ResetContext : Sets the new context, and return the old context, which the caller can use to cancel the previous context.

func (*ContextWrapper) ToCancel

func (c *ContextWrapper) ToCancel(ctx context.Context) bool

ToCancel : Helper function to check if the previous context should be cancelled. Note that this does not check the current context stored in the wrapper.

type SelectorWrapper

type SelectorWrapper struct {
	Selection map[int]struct{} // Keep track of which chapters have been selected by user.
	All       bool             // Keep track of whether user has selected All or not.
}

keep track of selections.

func (*SelectorWrapper) AddSelection

func (s *SelectorWrapper) AddSelection(row int)

AddSelection : Add a row to the Selection.

func (*SelectorWrapper) CopySelection

func (s *SelectorWrapper) CopySelection() map[int]struct{}

CopySelection : Returns a copy of the current Selection.

func (*SelectorWrapper) HasSelection

func (s *SelectorWrapper) HasSelection(row int) bool

HasSelection : Checks whether the current row is selected.

func (*SelectorWrapper) HasSelections

func (s *SelectorWrapper) HasSelections() bool

HasSelections : Checks whether there are currently selections.

func (*SelectorWrapper) RemoveSelection

func (s *SelectorWrapper) RemoveSelection(row int)

RemoveSelection : Remove a row from the Selection. No-op if row is not originally in Selection.

Jump to

Keyboard shortcuts

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