diff --git a/pydm/layouts/__init__.py b/pydm/layouts/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/pydm/layouts/absolute_geometry_layout.py b/pydm/layouts/absolute_geometry_layout.py new file mode 100644 index 000000000..733a7e4c9 --- /dev/null +++ b/pydm/layouts/absolute_geometry_layout.py @@ -0,0 +1,24 @@ +""" +Layout Manager for MEDM widgets. + +Widgets are placed on this layout in absolute coordinates. +When the layout is resized, the manager will resize each of the +widgets in the layout. +""" + +import logging + +from qtpy.QtWidgets import QLayout, QVBoxLayout +from qtpy import QtDesigner + +logger = logging.getLogger(__name__) + + +class AbsoluteGeometryLayout(QLayout): + """ + Layout Manager for widgets laid out by absolute geometry (such as MEDM). + + Widgets are added to this layout with absolute geometry (x,y,height,width). + When the layout is resized, the manager will resize each of the + widgets in the layout. + """ diff --git a/pydm/widgets/qtplugins.py b/pydm/widgets/qtplugins.py index fe40715f4..47d62fcb2 100644 --- a/pydm/widgets/qtplugins.py +++ b/pydm/widgets/qtplugins.py @@ -45,6 +45,7 @@ from .template_repeater import PyDMTemplateRepeater from .terminator import PyDMTerminator +from ..layouts.absolute_geometry_layout import AbsoluteGeometryLayout from ..utilities.iconfont import IconFont logger = logging.getLogger(__name__) @@ -261,3 +262,10 @@ PyDMTerminatorPlugin = qtplugin_factory(PyDMTerminator, group=WidgetCategory.MISC, extensions=BASE_EXTENSIONS) + +# ------ layouts (may be replaced by a custom widget that uses this layout) + +AbsoluteGeometryLayoutPlugin = qtplugin_factory(AbsoluteGeometryLayout, + group='PyDM Layouts', + is_container=True, + extensions=BASE_EXTENSIONS)