bec_widgets.utils.screen_utils#
Functions#
|
|
|
|
|
Get the available geometry of the screen associated with the given widget or application. |
|
Calculate centered geometry within the available rectangle. |
|
|
|
|
|
Module Contents#
- apply_centered_size(window: qtpy.QtWidgets.QWidget, width: int, height: int, *, available: qtpy.QtCore.QRect | None = None) None#
- 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#
- 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.
- Parameters:
widget (QWidget | None) – The widget to get the screen from.
- Returns:
The available geometry of the screen, or None if no screen is found.
- Return type:
QRect | None
- centered_geometry(available: qtpy.QtCore.QRect, width: int, height: int) tuple[int, int, int, int]#
Calculate centered geometry within the available rectangle.
- Parameters:
available (QRect) – The available rectangle to center within.
width (int) – The desired width.
height (int) – The desired height.
- Returns:
The (x, y, width, height) of the centered geometry.
- Return type:
tuple[int, int, int, int]
- centered_geometry_for_app(width: int, height: int) tuple[int, int, int, int] | None#
- main_app_size_for_screen(available: qtpy.QtCore.QRect) tuple[int, int]#
- 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#