Screen and Window: remove modal flag.

pull/8/head
Peter Hinch 2021-07-09 19:11:27 +01:00
rodzic dd250cc40e
commit a81946a82e
2 zmienionych plików z 7 dodań i 7 usunięć

Wyświetl plik

@ -17,10 +17,12 @@ It is compatible with all display drivers for
[nano-gui](https://github.com/peterhinch/micropython-nano-gui) so is portable
to a wide range of displays. It is also portable between hosts.
![Image](./images/rp2_test_fixture.JPG) Raspberry Pico/ILI9341.
![Image](./images/rp2_test_fixture.JPG)
Raspberry Pico with an ILI9341 from eBay.
![Image](./images/ttgo.JPG) TTGO T-Display. Add a joystick switch and an SIL
resistor for a simple, inexpensive, WiFi capable system.
![Image](./images/ttgo.JPG)
TTGO T-Display. A joystick switch and an SIL resistor make a simple inexpensive
and WiFi-capable system.
# Rationale

Wyświetl plik

@ -336,7 +336,6 @@ class Screen:
self.selected_obj = None # Index of currently selected object
self.displaylist = [] # All displayable objects
self.tasks = [] # Instance can register tasks for cancellation
self.modal = False
self.height = ssd.height # Occupies entire display
self.width = ssd.width
self.row = 0
@ -349,8 +348,8 @@ class Screen:
def _do_open(self, old_screen): # Window overrides
dev = display.usegrey(False)
# If opening a Screen from an Window just blank and redraw covered area
if old_screen is not None and old_screen.modal:
# If opening a Screen from a Window just blank and redraw covered area
if isinstance(old_screen, Window):
x0, y0, x1, y1, w, h = old_screen._list_dims()
dev.fill_rect(x0, y0, w, h, BGCOLOR) # Blank to screen BG
for obj in [z for z in self.displaylist if z.overlaps(x0, y0, x1, y1)]:
@ -483,7 +482,6 @@ class Window(Screen):
self.height = height
self.width = width
self.draw_border = draw_border
self.modal = True
self.fgcolor = fgcolor if fgcolor is not None else WHITE
self.bgcolor = bgcolor if bgcolor is not None else BGCOLOR