kopia lustrzana https://github.com/peterhinch/micropython-micro-gui
Screen and Window: remove modal flag.
rodzic
dd250cc40e
commit
a81946a82e
|
@ -17,10 +17,12 @@ It is compatible with all display drivers for
|
||||||
[nano-gui](https://github.com/peterhinch/micropython-nano-gui) so is portable
|
[nano-gui](https://github.com/peterhinch/micropython-nano-gui) so is portable
|
||||||
to a wide range of displays. It is also portable between hosts.
|
to a wide range of displays. It is also portable between hosts.
|
||||||
|
|
||||||
 Raspberry Pico/ILI9341.
|

|
||||||
|
Raspberry Pico with an ILI9341 from eBay.
|
||||||
|
|
||||||
 TTGO T-Display. Add a joystick switch and an SIL
|

|
||||||
resistor for a simple, inexpensive, WiFi capable system.
|
TTGO T-Display. A joystick switch and an SIL resistor make a simple inexpensive
|
||||||
|
and WiFi-capable system.
|
||||||
|
|
||||||
# Rationale
|
# Rationale
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,6 @@ class Screen:
|
||||||
self.selected_obj = None # Index of currently selected object
|
self.selected_obj = None # Index of currently selected object
|
||||||
self.displaylist = [] # All displayable objects
|
self.displaylist = [] # All displayable objects
|
||||||
self.tasks = [] # Instance can register tasks for cancellation
|
self.tasks = [] # Instance can register tasks for cancellation
|
||||||
self.modal = False
|
|
||||||
self.height = ssd.height # Occupies entire display
|
self.height = ssd.height # Occupies entire display
|
||||||
self.width = ssd.width
|
self.width = ssd.width
|
||||||
self.row = 0
|
self.row = 0
|
||||||
|
@ -349,8 +348,8 @@ class Screen:
|
||||||
|
|
||||||
def _do_open(self, old_screen): # Window overrides
|
def _do_open(self, old_screen): # Window overrides
|
||||||
dev = display.usegrey(False)
|
dev = display.usegrey(False)
|
||||||
# If opening a Screen from an Window just blank and redraw covered area
|
# If opening a Screen from a Window just blank and redraw covered area
|
||||||
if old_screen is not None and old_screen.modal:
|
if isinstance(old_screen, Window):
|
||||||
x0, y0, x1, y1, w, h = old_screen._list_dims()
|
x0, y0, x1, y1, w, h = old_screen._list_dims()
|
||||||
dev.fill_rect(x0, y0, w, h, BGCOLOR) # Blank to screen BG
|
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)]:
|
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.height = height
|
||||||
self.width = width
|
self.width = width
|
||||||
self.draw_border = draw_border
|
self.draw_border = draw_border
|
||||||
self.modal = True
|
|
||||||
self.fgcolor = fgcolor if fgcolor is not None else WHITE
|
self.fgcolor = fgcolor if fgcolor is not None else WHITE
|
||||||
self.bgcolor = bgcolor if bgcolor is not None else BGCOLOR
|
self.bgcolor = bgcolor if bgcolor is not None else BGCOLOR
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue