-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathposition.go
More file actions
54 lines (50 loc) · 1.1 KB
/
position.go
File metadata and controls
54 lines (50 loc) · 1.1 KB
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
48
49
50
51
52
53
54
package bubbleup
type Position string
func (p Position) IsValid() bool {
return p.String() != "unknown"
}
func (p Position) String() string {
switch p {
case TopLeftPosition:
return "top-left"
case TopCenterPosition:
return "top-center"
case TopRightPosition:
return "top-right"
case BottomLeftPosition:
return "bottom-left"
case BottomCenterPosition:
return "bottom-center"
case BottomRightPosition:
return "bottom-right"
default:
return "unknown"
}
}
func (p Position) Label() string {
switch p {
case TopLeftPosition:
return "Top Left"
case TopCenterPosition:
return "Top Center"
case TopRightPosition:
return "Top Right"
case BottomLeftPosition:
return "Bottom Left"
case BottomCenterPosition:
return "Bottom Center"
case BottomRightPosition:
return "Bottom Right"
default:
return "Unknown"
}
}
const (
TopLeftPosition Position = "TL"
TopCenterPosition Position = "TC"
TopRightPosition Position = "TR"
BottomLeftPosition Position = "BL"
BottomCenterPosition Position = "BC"
BottomRightPosition Position = "BR"
UnspecifiedPosition Position = ""
)