Fix dropdown text color.

pull/8/head
Peter Hinch 2021-06-11 08:51:22 +01:00
rodzic 190a8d5022
commit 561022cf38
6 zmienionych plików z 6 dodań i 3 usunięć

Wyświetl plik

@ -848,6 +848,8 @@ means of the instance's `value` or `textvalue` methods.
from gui.widgets.dropdown import Dropdown
```
![Image](./images/dd_closed.JPG) ![Image](./images/dd_open.JPG)
A dropdown list. The list, when active, is drawn below the control. The height
of the control is determined by the height of the font in use. The height of
the list is determined by the number of entries in it and the font in use.
@ -953,6 +955,7 @@ in `gui/demos/screens.py`.
```python
from gui.widgets.textbox import Textbox
```
![Image](./images/textbox.JPG)
Displays multiple lines of text in a field of fixed dimensions. Text may be
clipped to the width of the control or may be word-wrapped. If the number of

Wyświetl plik

@ -27,7 +27,7 @@ class _ListDialog(Window):
super().__init__(row, col, ap_height, ap_width)
self.listbox = Listbox(writer, row + 3, col + 3, elements = elements, width = lb_width,
fgcolor = dd.fgcolor, bgcolor = dd.bgcolor, bdcolor=False,
fontcolor = WHITE, select_color = dd.select_color,
fontcolor = dd.fontcolor, select_color = dd.select_color,
value = dd.value(), callback = self.callback)
self.dropdown = dd

Wyświetl plik

@ -60,9 +60,9 @@ class Listbox(Widget):
for n in range(length):
if n == self._value:
display.fill_rect(x, y + 1, self.width, self.entry_height - 1, self.select_color)
display.print_left(self.writer, x + 2, y + 1, self.elements[n], self.fgcolor, self.select_color)
display.print_left(self.writer, x + 2, y + 1, self.elements[n], self.fontcolor, self.select_color)
else:
display.print_left(self.writer, x + 2, y + 1, self.elements[n], self.fgcolor, self.bgcolor)
display.print_left(self.writer, x + 2, y + 1, self.elements[n], self.fontcolor, self.bgcolor)
y += self.entry_height
def textvalue(self, text=None): # if no arg return current text

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 30 KiB

BIN
images/dd_open.JPG 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 68 KiB

BIN
images/textbox.JPG 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 126 KiB