kopia lustrzana https://github.com/peterhinch/micropython-micro-gui
Fix dropdown text color.
rodzic
190a8d5022
commit
561022cf38
|
@ -848,6 +848,8 @@ means of the instance's `value` or `textvalue` methods.
|
|||
from gui.widgets.dropdown import Dropdown
|
||||
```
|
||||
|
||||
 
|
||||
|
||||
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
|
||||
```
|
||||

|
||||
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 68 KiB |
Plik binarny nie jest wyświetlany.
Po Szerokość: | Wysokość: | Rozmiar: 126 KiB |
Ładowanie…
Reference in New Issue