plesty.server.view.app ====================== .. py:module:: plesty.server.view.app .. autoapi-nested-parse:: Open the console: Qt application, plesty-lib theme, our stylesheet, the window. Attributes ---------- .. autoapisummary:: plesty.server.view.app.UI_FONTS plesty.server.view.app.MONO_FONTS Functions --------- .. autoapisummary:: plesty.server.view.app.pick_font plesty.server.view.app.stylesheet plesty.server.view.app.mark_icon plesty.server.view.app.application plesty.server.view.app.build_window plesty.server.view.app.run_gui plesty.server.view.app._version Module Contents --------------- .. py:data:: UI_FONTS :value: ('Inter', 'SF Pro Text', 'Segoe UI', 'Helvetica Neue', 'Arial') .. py:data:: MONO_FONTS :value: ('SF Mono', 'Menlo', 'Consolas', 'DejaVu Sans Mono', 'Courier New') .. py:function:: pick_font(candidates: tuple[str, Ellipsis], fallback: str) -> str The first of *candidates* the host has, else *fallback* — quoted for QSS. Asked rather than listed: Qt warns at start-up for every stylesheet family that is missing on the host, and the answer differs per bench. .. py:function:: stylesheet(theme: plesty.lib.ui.theme.Theme | None = None) -> str The console stylesheet: ``assets/console.qss`` with the palette and fonts substituted. .. py:function:: mark_icon() -> PySide6.QtGui.QIcon The PLESTY mark (``assets/plesty-mark.svg``, the static version) as a window icon. .. py:function:: application() -> PySide6.QtWidgets.QApplication The running Qt application, created, themed and branded when there is none. .. py:function:: build_window(bench: plesty.server.presenter.Bench, title: str | None = None) -> plesty.server.view.window.MainWindow A themed main window on *bench* (the application must exist). .. py:function:: run_gui(bench: plesty.server.presenter.Bench, title: str | None = None) -> int Open the console on *bench* and run until the window closes; returns the exit code. .. py:function:: _version() -> str