mirror of https://github.com/mum4k/termdash.git
Format files with gofmt from Golang 1.20.
Signed-off-by: Jakub Sobon <jakub.sobon@elohim.sk>
This commit is contained in:
parent
52ebd80b87
commit
94d07aea18
|
@ -53,11 +53,13 @@ func (b *Builder) Build() ([]container.Option, error) {
|
|||
|
||||
// validate recursively validates the elements that were added to the builder.
|
||||
// Validates the following per each level of Rows or Columns.:
|
||||
//
|
||||
// The subElements are either exactly one Widget or any number of Rows and
|
||||
// Columns.
|
||||
// Each individual width or height is in the range 0 < v < 100.
|
||||
// The sum of all widths is <= 100.
|
||||
// The sum of all heights is <= 100.
|
||||
//
|
||||
// Argument fixedSizeParent indicates if any of the parent elements uses fixed
|
||||
// size splitType.
|
||||
func validate(elems []Element, fixedSizeParent bool) error {
|
||||
|
@ -182,14 +184,23 @@ func build(elems []Element, parentHeightPerc, parentWidthPerc int) []container.O
|
|||
// E.g. multiple rows would specify that they want the outer split percentage
|
||||
// of 25% each, but we are representing them in a tree of containers so the
|
||||
// inner splits vary:
|
||||
//
|
||||
// ╭─────────╮
|
||||
//
|
||||
// 25% │ 25% │
|
||||
//
|
||||
// │╭───────╮│ ---
|
||||
//
|
||||
// 25% ││ 33% ││
|
||||
//
|
||||
// ││╭─────╮││
|
||||
//
|
||||
// 25% │││ 50% │││
|
||||
//
|
||||
// ││├─────┤││ 75%
|
||||
//
|
||||
// 25% │││ 50% │││
|
||||
//
|
||||
// ││╰─────╯││
|
||||
// │╰───────╯│
|
||||
// ╰─────────╯ ---
|
||||
|
|
|
@ -75,6 +75,7 @@ func VerticalTextOverrunMode(om OverrunMode) VerticalTextOption {
|
|||
|
||||
// VerticalText prints the provided text on the canvas starting at the provided point.
|
||||
// The text is printed in a vertical orientation, i.e:
|
||||
//
|
||||
// H
|
||||
// e
|
||||
// l
|
||||
|
|
|
@ -128,6 +128,7 @@ func (ar *angleRange) contains(angle int) bool {
|
|||
// normalizeRange normalizes the start and end angles in degrees into ranges of
|
||||
// angles. Useful for cases where the 0/360 point falls within the range.
|
||||
// E.g:
|
||||
//
|
||||
// 0,25 => angleRange{0, 26}
|
||||
// 0,360 => angleRange{0, 361}
|
||||
// 359,20 => angleRange{359, 361}, angleRange{0, 21}
|
||||
|
@ -159,6 +160,7 @@ func normalizeRange(start, end int) ([]*angleRange, error) {
|
|||
|
||||
// RangeSize returns the size of the degree range.
|
||||
// E.g:
|
||||
//
|
||||
// 0,25 => 25
|
||||
// 359,1 => 2
|
||||
func RangeSize(start, end int) (int, error) {
|
||||
|
@ -174,6 +176,7 @@ func RangeSize(start, end int) (int, error) {
|
|||
|
||||
// RangeMid returns an angle that lies in the middle between start and end.
|
||||
// E.g:
|
||||
//
|
||||
// 0,10 => 5
|
||||
// 350,10 => 0
|
||||
func RangeMid(start, end int) (int, error) {
|
||||
|
|
|
@ -100,6 +100,7 @@ func SkipSlopesLTE(v int) Option {
|
|||
// |
|
||||
//
|
||||
// With this option:
|
||||
//
|
||||
// --- |
|
||||
// - ||
|
||||
// |
|
||||
|
|
|
@ -976,8 +976,10 @@ func newLayoutButtons(c *container.Container, w *widgets) (*layoutButtons, error
|
|||
|
||||
// rotateFloats returns a new slice with inputs rotated by step.
|
||||
// I.e. for a step of one:
|
||||
//
|
||||
// inputs[0] -> inputs[len(inputs)-1]
|
||||
// inputs[1] -> inputs[0]
|
||||
//
|
||||
// And so on.
|
||||
func rotateFloats(inputs []float64, step int) []float64 {
|
||||
return append(inputs[step:], inputs[:step]...)
|
||||
|
@ -985,8 +987,10 @@ func rotateFloats(inputs []float64, step int) []float64 {
|
|||
|
||||
// rotateRunes returns a new slice with inputs rotated by step.
|
||||
// I.e. for a step of one:
|
||||
//
|
||||
// inputs[0] -> inputs[len(inputs)-1]
|
||||
// inputs[1] -> inputs[0]
|
||||
//
|
||||
// And so on.
|
||||
func rotateRunes(inputs []rune, step int) []rune {
|
||||
return append(inputs[step:], inputs[:step]...)
|
||||
|
|
|
@ -328,6 +328,7 @@ func (xs *XScale) CellLabel(x int) (*Value, error) {
|
|||
// the position. Positions grow up, coordinates grow down.
|
||||
//
|
||||
// Positions Y Coordinates
|
||||
//
|
||||
// 2 | 0
|
||||
// 1 | 1
|
||||
// 0 | 2
|
||||
|
|
|
@ -62,8 +62,10 @@ func clock(ctx context.Context, sd *segmentdisplay.SegmentDisplay) {
|
|||
|
||||
// rotate returns a new slice with inputs rotated by step.
|
||||
// I.e. for a step of one:
|
||||
//
|
||||
// inputs[0] -> inputs[len(inputs)-1]
|
||||
// inputs[1] -> inputs[0]
|
||||
//
|
||||
// And so on.
|
||||
func rotate(inputs []rune, step int) []rune {
|
||||
return append(inputs[step:], inputs[:step]...)
|
||||
|
|
|
@ -105,7 +105,9 @@ func (t *Text) contentCells() int {
|
|||
// Write writes text for the widget to display. Multiple calls append
|
||||
// additional text. The text contain cannot control characters
|
||||
// (unicode.IsControl) or space character (unicode.IsSpace) other than:
|
||||
//
|
||||
// ' ', '\n'
|
||||
//
|
||||
// Any newline ('\n') characters are interpreted as newlines when displaying
|
||||
// the text.
|
||||
func (t *Text) Write(text string, wOpts ...WriteOption) error {
|
||||
|
|
|
@ -34,8 +34,10 @@ import (
|
|||
|
||||
// rotate returns a new slice with inputs rotated by step.
|
||||
// I.e. for a step of one:
|
||||
//
|
||||
// inputs[0] -> inputs[len(inputs)-1]
|
||||
// inputs[1] -> inputs[0]
|
||||
//
|
||||
// And so on.
|
||||
func rotate(inputs []rune, step int) []rune {
|
||||
return append(inputs[step:], inputs[:step]...)
|
||||
|
|
Loading…
Reference in New Issue