Fix applying ScrollBarNever to DropDown or InputField

merge-requests/1/merge
Trevor Slocum 3 years ago
parent b4090e9215
commit de6819cc76

@ -386,7 +386,7 @@ func (d *DropDown) Draw(screen tcell.Screen) {
lheight = sheight - ly
}
lwidth := maxWidth
if len(d.options) > lheight {
if d.list.scrollBarVisibility == ScrollBarAlways || (d.list.scrollBarVisibility == ScrollBarAuto && len(d.options) > lheight) {
lwidth++ // Add space for scroll bar
}
d.list.SetRect(lx, ly, lwidth, lheight)

@ -422,7 +422,7 @@ func (i *InputField) Draw(screen tcell.Screen) {
if ly+lheight >= sheight {
lheight = sheight - ly
}
if i.autocompleteList.GetItemCount() > lheight {
if i.autocompleteList.scrollBarVisibility == ScrollBarAlways || (i.autocompleteList.scrollBarVisibility == ScrollBarAuto && i.autocompleteList.GetItemCount() > lheight) {
lwidth++ // Add space for scroll bar
}
i.autocompleteList.SetRect(lx, ly, lwidth, lheight)

Loading…
Cancel
Save