Writer and Listbox bug fixes.

pull/8/head
Peter Hinch 2021-09-19 12:02:09 +01:00
rodzic 6f7a9e8914
commit a931e1a14e
2 zmienionych plików z 4 dodań i 1 usunięć

Wyświetl plik

@ -150,6 +150,8 @@ class Writer():
self._printline(rstr, invert) # Recurse
def stringlen(self, string, oh=False):
if not len(string):
return 0
sc = self._getstate().text_col # Start column
wd = self.screenwidth
l = 0

Wyświetl plik

@ -79,7 +79,8 @@ class Listbox(Widget):
eh = self.entry_height
ntop = self.ntop
dlines = self.dlines
for n in range(ntop, ntop + dlines):
nlines = min(dlines, len(self.elements)) # Displayable lines
for n in range(ntop, ntop + nlines):
if n == self._value:
display.fill_rect(x, y + 1, self.width, eh - 1, self.select_color)
display.print_left(self.writer, x + 2, y + 1, self.elements[n], self.fontcolor, self.select_color)