bec_widgets.utils.screen_utils ============================== .. py:module:: bec_widgets.utils.screen_utils Functions --------- .. autoapisummary:: bec_widgets.utils.screen_utils.apply_centered_size bec_widgets.utils.screen_utils.apply_window_geometry bec_widgets.utils.screen_utils.available_screen_geometry bec_widgets.utils.screen_utils.centered_geometry bec_widgets.utils.screen_utils.centered_geometry_for_app bec_widgets.utils.screen_utils.main_app_size_for_screen bec_widgets.utils.screen_utils.scaled_centered_geometry_for_window Module Contents --------------- .. py:function:: apply_centered_size(window: qtpy.QtWidgets.QWidget, width: int, height: int, *, available: qtpy.QtCore.QRect | None = None) -> None .. py:function:: apply_window_geometry(window: qtpy.QtWidgets.QWidget, geometry: tuple[int, int, int, int] | None, *, width_ratio: float = 0.8, height_ratio: float = 0.8) -> None .. py:function:: available_screen_geometry(*, widget: qtpy.QtWidgets.QWidget | None = None) -> qtpy.QtCore.QRect | None Get the available geometry of the screen associated with the given widget or application. :param widget: The widget to get the screen from. :type widget: QWidget | None :returns: The available geometry of the screen, or None if no screen is found. :rtype: QRect | None .. py:function:: centered_geometry(available: qtpy.QtCore.QRect, width: int, height: int) -> tuple[int, int, int, int] Calculate centered geometry within the available rectangle. :param available: The available rectangle to center within. :type available: QRect :param width: The desired width. :type width: int :param height: The desired height. :type height: int :returns: The (x, y, width, height) of the centered geometry. :rtype: tuple[int, int, int, int] .. py:function:: centered_geometry_for_app(width: int, height: int) -> tuple[int, int, int, int] | None .. py:function:: main_app_size_for_screen(available: qtpy.QtCore.QRect) -> tuple[int, int] .. py:function:: scaled_centered_geometry_for_window(window: qtpy.QtWidgets.QWidget, *, width_ratio: float = 0.8, height_ratio: float = 0.8) -> tuple[int, int, int, int] | None