Some work
This commit is contained in:
@@ -22,6 +22,7 @@ THE SOFTWARE.
|
||||
package widgets
|
||||
|
||||
import (
|
||||
h "git.bullercodeworks.com/brian/tcell-widgets/helpers"
|
||||
wh "git.bullercodeworks.com/brian/tcell-widgets/helpers"
|
||||
"github.com/gdamore/tcell"
|
||||
)
|
||||
@@ -235,9 +236,7 @@ func (w *SimpleList) WantH() int {
|
||||
|
||||
func (w *SimpleList) MinW() int {
|
||||
lng := wh.Longest(w.list)
|
||||
if lng > 80 {
|
||||
lng = 80
|
||||
}
|
||||
lng = h.Min(lng, 80)
|
||||
return 2 + lng
|
||||
}
|
||||
|
||||
@@ -252,6 +251,9 @@ func (w *SimpleList) MoveUp() bool {
|
||||
}
|
||||
return true
|
||||
} else if w.cursorWrap {
|
||||
if w.cursor <= 0 {
|
||||
return false
|
||||
}
|
||||
w.cursor = len(w.list) - 1
|
||||
if w.onChange != nil {
|
||||
w.onChange(w.cursor, w.list[w.cursor])
|
||||
@@ -270,7 +272,7 @@ func (w *SimpleList) MoveDown() bool {
|
||||
return true
|
||||
} else if w.cursorWrap {
|
||||
w.cursor = 0
|
||||
if w.onChange != nil {
|
||||
if len(w.list) > w.cursor && w.onChange != nil {
|
||||
w.onChange(w.cursor, w.list[w.cursor])
|
||||
}
|
||||
return true
|
||||
|
||||
Reference in New Issue
Block a user