schrodinger.ui.qt.standard_widgets.buttons module¶
Module containing classes for buttons styled for use in Schrodinger panels.
- schrodinger.ui.qt.standard_widgets.buttons.apply_style_sheet_to_button(button, style, margin_height=0, margin_width=3)¶
Apply a Schrodinger color scheme CSS to the given QPushButton object.
- Parameters
button (QtWidgets.QPushButton) – Button to apply the styling to.
style (
StyledButton.Style
) – Style to usemargin_height (Union[float, int]) – Margin height of the PushButton in pixels
margin_width (Union[float, int]) – Margin width of the PushButton in pixels
- class schrodinger.ui.qt.standard_widgets.buttons.DoubleClickButtonMixin(*args, **kwargs)¶
Bases:
object
Mixin that includes a double click signal for push button.
Include this mixin with a QPushButton subclass and singleClicked and doubleClicked will work out of the box.
- Variables
DOUBLE_CLICK_TIME (int) – the amount of time to trigger double click (ms)
doubleClicked (QtCore.pyqtSignal) – a signal that the button was double clicked
singleClicked (QtCore.pyqtSignal) – a signal that the button was single clicked
- doubleClicked¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- singleClicked¶
pyqtSignal(*types, name: str = …, revision: int = …, arguments: Sequence = …) -> PYQT_SIGNAL
types is normally a sequence of individual types. Each type is either a type object or a string that is the name of a C++ type. Alternatively each type could itself be a sequence of types each describing a different overloaded signal. name is the optional C++ name of the signal. If it is not specified then the name of the class attribute that is bound to the signal is used. revision is the optional revision of the signal that is exported to QML. If it is not specified then 0 is used. arguments is the optional sequence of the names of the signal’s arguments.
- __init__(*args, **kwargs)¶
- mouseDoubleClickEvent(event: PyQt6.QtGui.QMouseEvent)¶
- class schrodinger.ui.qt.standard_widgets.buttons.StyledButton(*args, **kwargs)¶
Bases:
PyQt6.QtWidgets.QPushButton
A QPushButton that uses custom CSS, and offers ability to be “highlighted” with a green background (e.g. for Run buttons).
- class Style(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
Bases:
enum.Enum
- Standard = 'Standard'¶
- Highlighted = 'Highlighted'¶
- HighlightedText = 'HighlightedText'¶
- __init__(*args, **kwargs)¶
- setStyle(style)¶
Set the style of the button to one of available styles.
- Parameters
style – Style to use.
- setHighlighted(highlighted)¶
Whether to make the button background green, to make the button “jump out” to the user as the next likely action to take. Similar to a “default” button state (often used in dialog boxes), except that it doesn’t activate on pressing of the “Enter” key.
- updateStyleSheet()¶
- class schrodinger.ui.qt.standard_widgets.buttons.SplitStyledButton(*args, **kwargs)¶
Bases:
schrodinger.ui.qt.standard_widgets.buttons.StyledButton
A StyledButton with no margin used for adjacent alignment.
Create a split button by placing multiple in an individual HBoxLayout with no spacing.
- updateStyleSheet()¶
- class schrodinger.ui.qt.standard_widgets.buttons.DoubleClickSplitStyledButton(*args, **kwargs)¶
Bases:
schrodinger.ui.qt.standard_widgets.buttons.DoubleClickButtonMixin
,schrodinger.ui.qt.standard_widgets.buttons.SplitStyledButton
Button with split styling and double click signal.
- class schrodinger.ui.qt.standard_widgets.buttons.FlatButton(*args, **kwargs)¶
Bases:
PyQt6.QtWidgets.QToolButton
A flat icon toolbutton. To use this, it’s necessary to call setIconPath with the appropriate path to get the icon to show up. If a different icon is to be used for hover/pressed states, call setHoverIconPath. The size of the icon can be specified using
setIconSize_
(there is already a Qt setIconSize method on the class)- __init__(*args, **kwargs)¶
- setIconPath(normal_path)¶
- setHoverIconPath(hover_path)¶
- setDisabledIconPath(disabled_path)¶
- setPressedIconPath(pressed_path)¶
- setIconSize_(width=None, height=None)¶
- updateStyleSheet()¶
- schrodinger.ui.qt.standard_widgets.buttons.add_menu_with_dummy_actions(button: PyQt6.QtWidgets.QPushButton) → None¶
Helper to test out PanelX menu visuals. Eventually we can get rid of this.
- class schrodinger.ui.qt.standard_widgets.buttons.SplitPushButton(text: str = '', *args, **kwargs)¶
Bases:
PyQt6.QtWidgets.QWidget
PanelX split push button. Contains both the left and right buttons
- INTERBUTTON_SPACING = 1¶
- SUB_BUTTON_STYLESHEET = '\n QPushButton#left_btn {\n border-top-right-radius: 0px;\n border-bottom-right-radius: 0px;\n margin-left: 0px;\n margin-right: 0px;\n }\n QPushButton#right_btn {\n border-top-left-radius: 0px;\n border-bottom-left-radius: 0px;\n margin-left: 0px;\n margin-right: 0px;\n width: 0px;\n }\n QPushButton#right_btn::menu-indicator {\n subcontrol-origin: content;\n subcontrol-position: center;\n left: -1px;\n }\n '¶
- __init__(text: str = '', *args, **kwargs)¶
- setEnabled(self, a0: bool)¶
- class schrodinger.ui.qt.standard_widgets.buttons.PopUpLink(*args, **kwargs)¶
Bases:
schrodinger.ui.qt.pop_up_widgets._AbstractButtonWithPopUp
,schrodinger.ui.qt.standard_widgets.hyperlink.ButtonWithArrowMixin
,PyQt6.QtWidgets.QPushButton