diff --git a/src/toad/qt/menu.py b/src/toad/qt/menu.py index 0b18d826b..9078c0909 100644 --- a/src/toad/qt/menu.py +++ b/src/toad/qt/menu.py @@ -142,12 +142,12 @@ def __init__(self, window: QWidget) -> None: @classmethod def of(cls, widget: QWidget) -> QtMenu: """The pop-up menu of the window `widget` is in: the window's own direct child.""" - return widget.window().findChild(cls, "toad-menu", Qt.FindChildOption.FindDirectChildrenOnly) + return QWidget.window(widget).findChild(cls, "toad-menu", Qt.FindChildOption.FindDirectChildrenOnly) @staticmethod def anchor_of(widget: QWidget) -> QRect: """`widget`'s rectangle in its window, as `show_entries` takes an anchor.""" - return QRect(widget.mapTo(widget.window(), widget.rect().topLeft()), widget.size()) + return QRect(widget.mapTo(QWidget.window(widget), widget.rect().topLeft()), widget.size()) def paint(self, renderer: QtLineRenderer) -> None: """One surface in the renderer's theme: the float tone (a tier above what it floats diff --git a/src/toad/qt/presented_window.py b/src/toad/qt/presented_window.py index 3624ec96e..7ac4766e2 100644 --- a/src/toad/qt/presented_window.py +++ b/src/toad/qt/presented_window.py @@ -127,7 +127,9 @@ def presentation_host(self) -> QWidget: if parent is None: raise TypeError(f"{type(self).__qualname__} is shown without the window it opens over " "as its parent") - return parent.window() + # QWidget.window, not parent.window(): a conversation view names its scroll surface + # `window` (the shared contract Textual also answers), shadowing the Qt method. + return QWidget.window(parent) def page_header(self) -> QWidget: """The ← header a filled window shows above its content, built the first time.""" diff --git a/tools/android/shipped_run.py b/tools/android/shipped_run.py index 5fb635340..3b2b852c6 100644 --- a/tools/android/shipped_run.py +++ b/tools/android/shipped_run.py @@ -199,15 +199,17 @@ def main(runtime: Path, app: Path, site_packages: Path) -> int: for candidate in site_packages.glob(f"{name}*"): if not (recipes / candidate.name).exists(): (recipes / candidate.name).symlink_to(candidate) - settings = work / "kept" / "config" / "toad" / "toad.json" + # qt_drive keeps its settings and state under its OUTDIR (`out/config`, `out/state`) + # whatever the environment holds, so the saved theme and the error files live there. + out = work / "out" + settings = out / "config" / "toad" / "toad.json" settings.parent.mkdir(parents=True) settings.write_text(json.dumps({"ui": {"theme": UNOFFERED_THEME}})) trust = work / "trust.pem" trust.write_text((app / "cacert.pem").read_text() + (work / "cert.pem").read_text()) - out = work / "out" result = shipped_qt(shipped, recipes, trust, profile, out) print(result.stdout[-6000:]) - errors = sorted((work / "kept" / "state").rglob("errors/*.txt")) + errors = sorted((out / "state").rglob("errors/*.txt")) failed = (result.returncode != 0 or "ModuleNotFoundError" in result.stdout + result.stderr or errors) if failed: print(result.stderr[-8000:], file=sys.stderr) @@ -217,7 +219,7 @@ def main(runtime: Path, app: Path, site_packages: Path) -> int: f"{len(errors)} error file(s)); TOAD_SHIPPED_KEEP=1 keeps its scratch folder", file=sys.stderr) return 1 print("shipped app ran every view kind and bound key on a scratch bus") - fault = fault_trace_failure(work / "kept" / "state", shipped, recipes) + fault = fault_trace_failure(out / "state", shipped, recipes) if fault: print(f"error: the shipped app's fault trace: {fault}", file=sys.stderr) return 1