aboutsummaryrefslogtreecommitdiff
path: root/ui/types.go
blob: a7918b5bc3a8d31040179e88f7f4e7f8014a2a43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package ui

const (
	Valid          = 0
	InvalidateTabs = 1 << iota
	InvalidateSidebar
	InvalidateStatusBar
)

const (
	InvalidateAll = InvalidateTabs | InvalidateSidebar | InvalidateStatusBar
)

type Geometry struct {
	row    int
	col    int
	width  int
	height int
}

type AercTab interface {
	Name() string
	Invalid() bool
	Render(at Geometry)
}

type UIState struct {
	Exit         bool
	InvalidPanes uint

	Panes struct {
		TabList   Geometry
		TabView   Geometry
		Sidebar   Geometry
		StatusBar Geometry
	}

	Tabs        []AercTab
	SelectedTab int

	Prompt struct {
		Prompt *string
		Text   *string
		Index  int
		Scroll int
	}
}