Fix List dividers allowing selection

This commit is contained in:
Trevor Slocum 2020-10-13 10:13:23 -07:00
parent 2877b77c18
commit 2fe1085168
2 changed files with 5 additions and 3 deletions

View File

@ -5,6 +5,7 @@ v1.5.1 (WIP)
- Add TableCell.SetBytes, TableCell.GetBytes and TableCell.GetText
- Fix List.Transform not calling handler set via SetChangedFunc
- Fix WordWrap bounds out of range
- Fix List dividers allowing selection
- Allow modification of scroll bar render text
- Allow scrolling List horizontally
- Optimize TextView (writing is 90% faster, drawing is 50% faster)

View File

@ -772,7 +772,7 @@ func (l *List) transform(tr Transformation) {
}
item := l.items[l.currentItem]
if item.enabled {
if item.enabled && (item.shortcut > 0 || len(item.mainText) > 0 || len(item.secondaryText) > 0) {
break
}
@ -846,10 +846,11 @@ func (l *List) updateOffset() {
addWidth = 1
}
if l.columnOffset > (maxWidth-l.innerWidth)+addWidth {
l.columnOffset = (maxWidth - l.innerWidth) + addWidth
}
if l.columnOffset < 0 {
l.columnOffset = 0
} else if l.columnOffset > (maxWidth-l.innerWidth)+addWidth {
l.columnOffset = (maxWidth - l.innerWidth) + addWidth
}
}