|
41 | 41 | _make_path_object_relative, |
42 | 42 | ) |
43 | 43 | from textual._types import CallbackType |
| 44 | +from textual._unique import unique_ordered |
44 | 45 | from textual.await_complete import AwaitComplete |
45 | 46 | from textual.binding import ActiveBinding, Binding, BindingsMap |
46 | 47 | from textual.css.match import match |
@@ -204,8 +205,9 @@ class Screen(Generic[ScreenResultType], Widget): |
204 | 205 |
|
205 | 206 | Should be a set of [`command.Provider`][textual.command.Provider] classes. |
206 | 207 | """ |
207 | | - ALLOW_IN_MAXIMIZED_VIEW: ClassVar[str] = ".-textual-system,Footer" |
208 | | - """A selector for the widgets (direct children of Screen) that are allowed in the maximized view (in addition to maximized widget).""" |
| 208 | + ALLOW_IN_MAXIMIZED_VIEW: ClassVar[str | None] = None |
| 209 | + """A selector for the widgets (direct children of Screen) that are allowed in the maximized view (in addition to maximized widget). Or |
| 210 | + `None` to default to [App.ALLOW_IN_MAXIMIZED_VIEW][textual.app.App.ALLOW_IN_MAXIMIZED_VIEW]""" |
209 | 211 |
|
210 | 212 | ESCAPE_TO_MINIMIZE: ClassVar[bool | None] = None |
211 | 213 | """Use escape key to minimize (potentially overriding bindings) or `None` to defer to [`App.ESCAPE_TO_MINIMIZE`][textual.app.App.ESCAPE_TO_MINIMIZE].""" |
@@ -434,10 +436,19 @@ def _arrange(self, size: Size) -> DockArrangeResult: |
434 | 436 | if cached_result is not None: |
435 | 437 | return cached_result |
436 | 438 |
|
| 439 | + allow_in_maximized_view = ( |
| 440 | + self.app.ALLOW_IN_MAXIMIZED_VIEW |
| 441 | + if self.ALLOW_IN_MAXIMIZED_VIEW is None |
| 442 | + else self.ALLOW_IN_MAXIMIZED_VIEW |
| 443 | + ) |
437 | 444 | arrangement = self._arrangement_cache[cache_key] = arrange( |
438 | 445 | self, |
439 | 446 | ( |
440 | | - [self.maximized, *self.query_children(self.ALLOW_IN_MAXIMIZED_VIEW)] |
| 447 | + unique_ordered( |
| 448 | + [self.maximized], |
| 449 | + self.query_children(allow_in_maximized_view), |
| 450 | + self.query_children(".-textual-system"), |
| 451 | + ) |
441 | 452 | if self.maximized is not None |
442 | 453 | else self._nodes |
443 | 454 | ), |
|
0 commit comments