Skip to content

Scrollable suites for displays #633

@aberges-SLAC

Description

@aberges-SLAC

Currently, when you call typhos --scrollable true you get vertical scroll bars in you display widgets, but not your suite:

Image

This is kind of awkward for vertical displays (or just in general when there are many widgets in your window, as we often have in the hutches).

It'd be nice to have the suite instead have a scrollbar which is tied to the layout. Very naive changes to

self._content_frame = QtWidgets.QFrame(self)
lead me to:

 self._scroll_area = QtWidgets.QScrollArea()
        self._scroll_area.setWidgetResizable(True)

        # Content frame layout: configurable
        # Defaults to [content] [content] [content] ... in one line
        if content_layout is None:
            content_layout = QtWidgets.QHBoxLayout()
        self._content_frame.setLayout(content_layout)

        self._scroll_area.setWidget(self._content_frame)
        self._scroll_area.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarPolicy.ScrollBarAlwaysOn)

        # Horizontal box layout: [PopBar] [Content Frame]
        layout = QtWidgets.QHBoxLayout()
        self.setLayout(layout)
        layout.setSpacing(1)
        layout.setContentsMargins(0, 0, 0, 0)
        layout.addWidget(self._bar)
        layout.addWidget(self._scroll_area)

Which gives me the desired effect:

Image

But we probably want to do this more intelligently and enforce some orthogonality so we don't have a bunch of parallel scroll bars (cough confluence cough)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions