Fix applying ScrollBarNever to DropDown or InputField

This commit is contained in:
Trevor Slocum 2020-02-13 15:08:35 -08:00
parent b4090e9215
commit de6819cc76
2 changed files with 2 additions and 2 deletions

View File

@ -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)

View File

@ -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)