layout

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Horizontal

type Horizontal struct {
	Top    Layout
	Bottom Layout
	// contains filtered or unexported fields
}

Horizontal holds two layout horizontally.

func (Horizontal) Activate

func (l Horizontal) Activate(i int) Layout

Activate the specific window layout.

func (Horizontal) ActivateFirst

func (l Horizontal) ActivateFirst() Layout

ActivateFirst the first layout.

func (Horizontal) ActiveWindow

func (l Horizontal) ActiveWindow() Window

ActiveWindow returns the active window.

func (Horizontal) Close

func (l Horizontal) Close() Layout

Close the active layout.

func (Horizontal) Collect

func (l Horizontal) Collect() map[int]Window

Collect returns all the Window.

func (Horizontal) Count

func (l Horizontal) Count() (int, int)

Count returns the width and height counts.

func (Horizontal) Height

func (l Horizontal) Height() int

Height returns the height.

func (Horizontal) LeftMargin

func (l Horizontal) LeftMargin() int

LeftMargin returns the left margin.

func (Horizontal) Lookup

func (l Horizontal) Lookup(cond func(Window) bool) Window

Lookup search for the window meets the condition.

func (Horizontal) Replace

func (l Horizontal) Replace(index int) Layout

Replace the active window with new window index.

func (Horizontal) Resize

func (l Horizontal) Resize(left, top, width, height int) Layout

Resize recalculates the position.

func (Horizontal) SplitBottom

func (l Horizontal) SplitBottom(index int) Layout

SplitBottom splits the layout and opens a new window to the bottom.

func (Horizontal) SplitLeft

func (l Horizontal) SplitLeft(index int) Layout

SplitLeft splits the layout and opens a new window to the left.

func (Horizontal) SplitRight

func (l Horizontal) SplitRight(index int) Layout

SplitRight splits the layout and opens a new window to the right.

func (Horizontal) SplitTop

func (l Horizontal) SplitTop(index int) Layout

SplitTop splits the layout and opens a new window to the top.

func (Horizontal) TopMargin

func (l Horizontal) TopMargin() int

TopMargin returns the top margin.

func (Horizontal) Width

func (l Horizontal) Width() int

Width returns the width.

type Layout

type Layout interface {
	Collect() map[int]Window
	Replace(int) Layout
	Resize(int, int, int, int) Layout
	LeftMargin() int
	TopMargin() int
	Width() int
	Height() int
	SplitTop(int) Layout
	SplitBottom(int) Layout
	SplitLeft(int) Layout
	SplitRight(int) Layout
	Count() (int, int)
	Activate(int) Layout
	ActivateFirst() Layout
	ActiveWindow() Window
	Lookup(func(Window) bool) Window
	Close() Layout
	// contains filtered or unexported methods
}

Layout represents the window layout.

func NewLayout

func NewLayout(index int) Layout

NewLayout creates a new Layout from a window index.

type Vertical

type Vertical struct {
	Left  Layout
	Right Layout
	// contains filtered or unexported fields
}

Vertical holds two layout vertically.

func (Vertical) Activate

func (l Vertical) Activate(i int) Layout

Activate the specific window layout.

func (Vertical) ActivateFirst

func (l Vertical) ActivateFirst() Layout

ActivateFirst the first layout.

func (Vertical) ActiveWindow

func (l Vertical) ActiveWindow() Window

ActiveWindow returns the active window.

func (Vertical) Close

func (l Vertical) Close() Layout

Close the active layout.

func (Vertical) Collect

func (l Vertical) Collect() map[int]Window

Collect returns all the Window.

func (Vertical) Count

func (l Vertical) Count() (int, int)

Count returns the width and height counts.

func (Vertical) Height

func (l Vertical) Height() int

Height returns the height.

func (Vertical) LeftMargin

func (l Vertical) LeftMargin() int

LeftMargin returns the left margin.

func (Vertical) Lookup

func (l Vertical) Lookup(cond func(Window) bool) Window

Lookup search for the window meets the condition.

func (Vertical) Replace

func (l Vertical) Replace(index int) Layout

Replace the active window with new window index.

func (Vertical) Resize

func (l Vertical) Resize(left, top, width, height int) Layout

Resize recalculates the position.

func (Vertical) SplitBottom

func (l Vertical) SplitBottom(index int) Layout

SplitBottom splits the layout and opens a new window to the bottom.

func (Vertical) SplitLeft

func (l Vertical) SplitLeft(index int) Layout

SplitLeft splits the layout and opens a new window to the left.

func (Vertical) SplitRight

func (l Vertical) SplitRight(index int) Layout

SplitRight splits the layout and opens a new window to the right.

func (Vertical) SplitTop

func (l Vertical) SplitTop(index int) Layout

SplitTop splits the layout and opens a new window to the top.

func (Vertical) TopMargin

func (l Vertical) TopMargin() int

TopMargin returns the top margin.

func (Vertical) Width

func (l Vertical) Width() int

Width returns the width.

type Window

type Window struct {
	Index  int
	Active bool
	// contains filtered or unexported fields
}

Window holds the window index and it is active or not.

func (Window) Activate

func (l Window) Activate(i int) Layout

Activate the specific window layout.

func (Window) ActivateFirst

func (l Window) ActivateFirst() Layout

ActivateFirst the first layout.

func (Window) ActiveWindow

func (l Window) ActiveWindow() Window

ActiveWindow returns the active window.

func (Window) Close

func (l Window) Close() Layout

Close the active layout.

func (Window) Collect

func (l Window) Collect() map[int]Window

Collect returns all the Window.

func (Window) Count

func (l Window) Count() (int, int)

Count returns the width and height counts.

func (Window) Height

func (l Window) Height() int

Height returns the height.

func (Window) LeftMargin

func (l Window) LeftMargin() int

LeftMargin returns the left margin.

func (Window) Lookup

func (l Window) Lookup(cond func(Window) bool) Window

Lookup search for the window meets the condition.

func (Window) Replace

func (l Window) Replace(index int) Layout

Replace the active window with new window index.

func (Window) Resize

func (l Window) Resize(left, top, width, height int) Layout

Resize recalculates the position.

func (Window) SplitBottom

func (l Window) SplitBottom(index int) Layout

SplitBottom splits the layout and opens a new window to the bottom.

func (Window) SplitLeft

func (l Window) SplitLeft(index int) Layout

SplitLeft splits the layout and opens a new window to the left.

func (Window) SplitRight

func (l Window) SplitRight(index int) Layout

SplitRight splits the layout and opens a new window to the right.

func (Window) SplitTop

func (l Window) SplitTop(index int) Layout

SplitTop splits the layout and opens a new window to the top.

func (Window) TopMargin

func (l Window) TopMargin() int

TopMargin returns the top margin.

func (Window) Width

func (l Window) Width() int

Width returns the width.

Jump to

Keyboard shortcuts

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