mirror of https://github.com/gizak/termui.git
Ran go fmt to clean it up a bit.
This commit is contained in:
parent
ff41683113
commit
91de22dab3
|
@ -34,7 +34,7 @@ func (self *List) Draw(buf *Buffer) {
|
||||||
point := self.Inner.Min
|
point := self.Inner.Min
|
||||||
|
|
||||||
if self.SelectedRow >= uint(self.Inner.Max.Y)+self.topRow-2 {
|
if self.SelectedRow >= uint(self.Inner.Max.Y)+self.topRow-2 {
|
||||||
self.topRow = self.SelectedRow-uint(self.Inner.Max.Y)+2
|
self.topRow = self.SelectedRow - uint(self.Inner.Max.Y) + 2
|
||||||
} else if self.SelectedRow < self.topRow {
|
} else if self.SelectedRow < self.topRow {
|
||||||
self.topRow = self.SelectedRow
|
self.topRow = self.SelectedRow
|
||||||
}
|
}
|
||||||
|
@ -96,20 +96,20 @@ func (self *List) ScrollDown() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *List) PageUp() { // Goes up one whole page.
|
func (self *List) PageUp() { // Goes up one whole page.
|
||||||
if int(self.SelectedRow)-self.Inner.Dy() >= 0 {
|
if int(self.SelectedRow)-self.Inner.Dy() >= 0 {
|
||||||
self.topRow -= uint(self.Inner.Dy())
|
self.topRow -= uint(self.Inner.Dy())
|
||||||
} else { // If at the first 'page', then go to the top and select the first item.
|
} else { // If at the first 'page', then go to the top and select the first item.
|
||||||
self.topRow = 0
|
self.topRow = 0
|
||||||
}
|
}
|
||||||
self.SelectedRow = self.topRow
|
self.SelectedRow = self.topRow
|
||||||
}
|
}
|
||||||
|
|
||||||
func (self *List) PageDown() { // Down one whole page
|
func (self *List) PageDown() { // Down one whole page
|
||||||
if len(self.Rows)-int(self.topRow) > self.Inner.Dy() {
|
if len(self.Rows)-int(self.topRow) > self.Inner.Dy() {
|
||||||
self.topRow += uint(self.Inner.Dy())
|
self.topRow += uint(self.Inner.Dy())
|
||||||
self.SelectedRow = self.topRow
|
self.SelectedRow = self.topRow
|
||||||
} else { // If at last 'page', then select last item.
|
} else { // If at last 'page', then select last item.
|
||||||
self.SelectedRow = uint(len(self.Rows)-1)
|
self.SelectedRow = uint(len(self.Rows) - 1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue