MCPcopy Index your code
hub / github.com/box-cli-maker/box-cli-maker / Style

Method Style

box.go:105–120  ·  view source on GitHub ↗

Style selects one of the built-in BoxStyle presets. Common styles include box.Single, box.Double, box.Round, box.Bold, box.SingleDouble, box.DoubleSingle, box.Classic, box.Hidden, and box.Block. To make custom styles, call TopRight, TopLeft, BottomRight, BottomLeft, Horizontal, and Vertical after

(box BoxStyle)

Source from the content-addressed store, hash-verified

103// b := box.NewBox()
104// b.TopRight("+").TopLeft("+").BottomRight("+").BottomLeft("_").Horizontal("-").Vertical("|")
105func (b *Box) Style(box BoxStyle) *Box {
106 b.config.style = box
107 b.styleSet = true
108 // Set the box style characters from predefined styles
109 // This also allows manual overrides after setting style
110 // and have a standard base.
111 if styleDef, ok := boxes[box]; ok {
112 b.BottomLeft(styleDef.bottomLeft).
113 BottomRight(styleDef.bottomRight).
114 TopLeft(styleDef.topLeft).
115 TopRight(styleDef.topRight).
116 Horizontal(styleDef.horizontal).
117 Vertical(styleDef.vertical)
118 }
119 return b
120}
121
122// TopRight sets the glyph used in the upper-right corner.
123func (b *Box) TopRight(glyph string) *Box {

Callers 15

NewBoxFunction · 0.95
TestRenderBasicBoxFunction · 0.80
TestBoxCopyFunction · 0.80
TestRenderTitlePositionsFunction · 0.80

Calls 6

BottomLeftMethod · 0.95
VerticalMethod · 0.80
HorizontalMethod · 0.80
TopRightMethod · 0.80
TopLeftMethod · 0.80
BottomRightMethod · 0.80