Skip to content

Commit

Permalink
WIP slaclab#857 just starting out
Browse files Browse the repository at this point in the history
  • Loading branch information
prjemian committed May 13, 2022
1 parent 5740b1a commit d139261
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 0 deletions.
Empty file added pydm/layouts/__init__.py
Empty file.
24 changes: 24 additions & 0 deletions pydm/layouts/absolute_geometry_layout.py
Original file line number Diff line number Diff line change
@@ -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.
"""
8 changes: 8 additions & 0 deletions pydm/widgets/qtplugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)
Expand Down Expand Up @@ -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)

0 comments on commit d139261

Please sign in to comment.